colorpale: determine more pale colors for given colors

View source: R/general.R

colorpaleR Documentation

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, ...)

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

Details

The function increases rgb coordinates of colors ‘proportionally’: crgb <- t(col2rgb(col)/255); rgb(1 - pale * (1 - crgb))

Value

character vector: names of colors to be used as color argument for graphical functions.

Author(s)

Werner A. Stahel, ETH Zurich

See Also

rgb

Examples

( t.col <- colorpale(c("red","blue")) )
plot(0:6, type="h", col=c("black","red","blue",t.col, colorpale(t.col)), lwd=5)

plgraphics documentation built on Oct. 19, 2023, 3 p.m.