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

From: <ccarey_at_fhcrc.org>
Date: Tue 01 Aug 2006 - 10:33:32 EST


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



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Tue Aug 01 10:41:12 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 02 Aug 2006 - 06:16:42 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.