colour_ramp | R Documentation |
Returns a function that maps the interval [0,1] to a set of colours.
Interpolation is performed in the CIELAB colour space. Similar to
colorRamp(space = 'Lab')
, but hundreds of
times faster, and provides results in "#RRGGBB"
(or
"#RRGGBBAA"
) character form instead of RGB colour matrices.
colour_ramp(colors, na.color = NA, alpha = TRUE)
colors |
Colours to interpolate; must be a valid argument to
|
na.color |
The colour to map to |
alpha |
Whether to include alpha transparency channels in interpolation.
If |
A function that takes a numeric vector and returns a character vector of the same length with RGB or RGBA hex colours.
colorRamp
ramp <- colour_ramp(c("red", "green", "blue"))
show_col(ramp(seq(0, 1, length = 12)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.