[R] rgb and col2rgb color conversion/modification/shading

ccarey at fhcrc.org ccarey at fhcrc.org
Tue Aug 1 02:33:32 CEST 2006


I want to get a lighter shade of a color...I have a lot of colored objects and
want each one printed as a foreground against a slightly lighter background.

I thought I could try something like changing the alpha channel by first
converting it to rgb. 

But prior to trying that, I'm stuck with how to get the color after converting
using col2rgb() to be interpreted again as a color, rather than a simple
vector?

Anyone have any help/ or alternative suggestion...

Thanks, -c
----------------------
TRYING WITH A SINGLE COLOR:

mycol<-"red"

> col2rgb(mycol)
      [,1]
red    255
green    0
blue     0

> rgb(col2rgb(mycol),maxColorValue=255)

Error in rgb(col2rgb("red")) : argument "green" is missing, with no default



More information about the R-help mailing list