colorpale: determine more pale colors for given colors
Description
Finds colors that are `equivalent' to the colors given as the first
argument, but more pale or less pale
Usage
colorpale(col = NA, pale = NULL, rgb = FALSE, ...)
Value
character vector: names of colors to be used as color argument
for graphical functions.
Arguments
col
a color or a vector of colors for which the pale version should be found
pale
number between -1 and 1 determining how much paler the result should
be. If =0, the original color, col will be returned
unchanged (but in the 'rgb' or 'hexadecimal' form). If =1 or
-1, the result is white (#FFFFFF) or black, respectively.
rgb
should result be expressed in 'rgb' form? If FALSE,
it will be in hexadecimal form.
...
further arguments passed on to rgb
if rgb is FALSE
Author
Werner A. Stahel, ETH Zurich
Details
The function increases rgb coordinates of colors `proportionally':
crgb <- t(col2rgb(col)/255);
rgb(1 - pale * (1 - crgb))