rainbow_hcl(n, c = 50, l = 70, start = 0, end = 360*(n-1)/n, ...)diverge_hcl(n, h = c(260, 0), c = 100, l = c(90, 50), ...)
diverge_hsv(n, h = c(2/3, 0), s = 1, v = 1, ...)
rainbow_hcl
computes a rainbow of colors
defined by different hues given a single value of each chroma and luminance.
It corresponds to rainbow
which computes a rainbow in
HSV space.
Both functions, diverge_hcl
and diverge_hsv
, compute
a set of colors diverging from a neutral center (grey or white, without
color) to two different extreme colors (blue and red by default). This
is similar to cm.colors
. For the diverging HSV colors,
two hues h
are needed, a maximal saturation s
and a
fixed value v
. The saturation is then varied to obtain the
diverging colors. For the diverging HCL colors, again two hues h
are needed, a maximal chroma chroma
and two luminances l
.
The colors are then created by linear interpolation between the full
chroma and minimal luminance and a chroma of 0 and maximal luminance. The diverging palettes are used for choosing the colors for mosaic
displays in mosaic
.
hcl
,
hsv
,
shadings
pie(rep(1, 12), col = rainbow_hcl(12))
pie(rep(1, 5), col = diverge_hcl(5))
pie(rep(1, 5), col = diverge_hsv(5))
Run the code above in your browser using DataLab