On Fri, Jun 6, 2008 at 3:37 PM, Michael Friendly <[EMAIL PROTECTED]> wrote: > In an R graphic, I'm using > > cond.col <- c("green", "yellow", "red") > to represent a quantitative variable, where green means 'OK', yellow > represents 'warning' > and red represents 'danger'. Using these particular color names, in B/W, red > is darkest > and yellow is lightest. I'd like to find color designations to replace > yellow and green so > that when printed in B/W, the yellowish color appears darker than the > greenish one.
An alternative approach would be to convert the colours into Luv, adjust luminance appropriately and then convert back: cond.col <- c("green", "yellow", "red") col <- col2rgb(cond.col) col.Luv <- convertColor(t(col), "sRGB", "Luv") rownames(col.Luv) <- cond.col col.Luv[, "L"] <- c(8000, 6000, 8000) t(convertColor(col.Luv, "Luv", "sRGB")) However, that doesn't actually seem to work - the back-transformed colours are the same as the original. Hadley -- http://had.co.nz/ ______________________________________________ R-help@r-project.org 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.