[R] Finding a color code.

Sundar Dorai-Raj sundar.dorai-raj at pdf.com
Mon Jun 26 18:25:09 CEST 2006



A Ezhil wrote:
> Hi,
> 
> Is it possible to find corresponding color code in R
> for the following RGB (R185, G35 & B80)? 
> 
> Thanks in advance.
> 
> Best regards,
> Ezhil
> 


How about:

x <- c(185, 35, 80)
class(x) <- "hexmode"
paste("#", paste(format(x), collapse = ""), sep = "")
[1] "#b92350"

I found this using

help.search("hex")

which led to ?format.hexmode.

HTH,

--sundar



More information about the R-help mailing list