View source: R/createColorPalette.R
createColorPalette | R Documentation |
Creates a color palette (or returns a pre-defined one).
createColorPalette(
name,
n = 1,
alpha = 1,
start = 0,
end = max(1, n - 1)/n,
s = 1,
v = 1,
bias = 1,
space = c("rgb", "Lab"),
interpolate = c("linear", "spline"),
clrs = c("#00007F", "blue", "#007FFF", "cyan", "#7FFF7F", "yellow", "#FF7F00", "red",
"#7F0000"),
showAsWheel = FALSE,
showAsBar = FALSE
)
name |
|
n |
|
alpha |
|
start |
|
end |
|
s |
|
v |
|
bias |
|
space |
|
interpolate |
|
clrs |
|
showAsWheel |
|
showAsBar |
|
New (interpolated) palettes can be created based on the following pre-defined palettes:
'rainbow', 'heat', 'topo', 'cm', and 'jet'
Specifying a pre-defined palette eliminates the need to specify the 'clrs' color vector.
Palettes can created based on arbitrary base palettes by specifying name as 'ramp' and providing a vector
of colors to use as the base palette (via clrs). This approach uses the graphics function "colorRampPalette"
to create the palette.
a color palette
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.