View source: R/createColorScale.R
createColorScale | R Documentation |
Creates a function defining a color scale. The resulting function (e.g., 'scale') is used as
clr <- scale(x,mn=sclMin,mx=sclMax,alpha=alpha)
to return a color based on the color associated with value x (scaled into the interval sclMin to sclMax)
in the defined color scale, with transparency 'alpha'.
createColorScale(
clrs = c("#00007F", "blue", "#007FFF", "cyan", "#7FFF7F", "yellow", "#FF7F00", "red",
"#7F0000"),
name = NULL,
bias = 1,
space = c("rgb", "Lab"),
interpolate = c("linear", "spline"),
showAsWheel = FALSE,
showAsBar = FALSE
)
clrs |
|
name |
|
bias |
|
space |
|
interpolate |
|
showAsWheel |
|
showAsBar |
|
New color scales can be created based on pre-defined color vectors using the following names:
'jet', 'coldhot', 'cold', and 'hot'
Specifying a pre-defined name eliminates the need to specify the 'clrs' color vector.
Arbitrary scales can created by specifying NULL for 'name' (the default) and providing a vector
of colors to use to define the scale function. This uses the grDevices package function "colorRamp" to define
the underlying color ramp used for the scale. Uses packages graphics
and grDevices].
a function reflecting a color scale.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.