| desaturate {colorspace} | R Documentation |
Transform a vector of given colors to the corresponding colors with chroma removed (collapsed to zero) in HCL space.
desaturate(col)
col |
vector of any of the three kind of R colors, i.e., either a
color name (an element of |
Given colors are first transformed to RGB (either using hex2RGB
or col2rgb) and then to HCL (polarLUV).
In HCL, chroma is removed (i.e., collapsed to zero) and then the color is
transformed back to a hexadecimal string.
A character vector with (s)RGB codings of the colors in the palette.
Achim Zeileis Achim.Zeileis@R-project.org
## convenience demo function wheel <- function(col, radius = 1, ...) pie(rep(1, length(col)), col = col, radius = radius, ...) ## compare base and colorspace palettes ## (in color and desaturated) par(mar = rep(0, 4), mfrow = c(2, 2)) ## rainbow color wheel wheel(rainbow_hcl(12)) wheel(rainbow(12)) wheel(desaturate(rainbow_hcl(12))) wheel(desaturate(rainbow(12)))