Description Usage Arguments Details Value
View source: R/createColorScale.R
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'.
1 2 3 4 |
name |
- name of base color scale (pre-defined: 'jet', 'coldhot', 'cold', and 'hot'; NULL for new scale) |
clrs |
- vector of colors defining the base scale (ignored if 'name' is given) |
bias |
- ?? |
space |
- colorspace ('rgb' or 'Lab') |
interpolate |
- interpolation scheme ('linear' or 'spline') |
showAsWheel |
- flag (T/F) to show the final palette as a colorwheel |
showAsBar |
- flag (T/F) to show final palette as a colorbar |
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 graphics function
"colorRamp" to define the underlying color ramp used for
the scale.
a function reflecting a color scale.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.