colscale | R Documentation |
Returns a color vector from the function 'fun' matching the input numeric object 'x', or a sequence of length 'x' from 'start' to 'end' if 'x' is a single integer value (whole number).
colscale(
x,
fun = c("rainbow", "grey", "fade.colorsx", "heat.colors", "terrain.colors",
"topo.colors", "cm.colors", "combined"),
start = 0,
end = 0.8,
h = 1/6,
s = 1,
v = 1,
sc = c(1, 0.3),
vc = c(0.7, 1),
flip = FALSE,
bias = 1,
space = c("rgb", "Lab"),
interpolate = c("linear", "spline", "fadewhite", "fadeblack"),
breakpoint = NULL,
alpha = 1,
...
)
x |
is either a numeric object to which colors should be matched, or the length of the color vector. |
fun |
is a character giving the name of the color function or the color function itself. |
start |
and 'end' are the start and end colors, given either as values in [0,1], or as color character strings in which case the output colors are interpolated between the given colors as specified by 'interpolate'. |
h |
is the value hue at the end point of the heat color vector, defaulted to 1/6 to move from red to yellow. |
s |
is the saturation parameter, only used in rainbowx(), where lower values suppress saturation. |
v |
is the value parameter, only used in rainbowx(), heat.colorsx(), topo.colorsx(), and cm.colorsx(), where lower values causes darker colors. |
sc |
is saturation parameter used in combinedx(). |
vc |
is value parameter used in combinedx(). |
flip |
is TRUE if the color vector is to be reversed. |
bias |
is a parameter used in colorRampPalette(). |
space |
is a parameter used in colorRampPalette(). |
interpolate |
is a parameter used in colorRampPalette(). |
breakpoint |
is the breakpoint of piecewise colors, defaulted in the different function called by colscale(). |
alpha |
is a parameter used in rainbow(), heat.colors(), terrain.colors(), topo.colors() and cm.colors(). |
... |
methods passed on to sub-functions (not used, but allowing for unused arguments). |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.