Learn R Programming

patchPlot (version 0.1.5)

getInterRGB: getInterRGB

Description

Interpolate colors in RGB-specified bounds.

Usage

getInterRGB(vals, zeroColor, oneColor)

Arguments

vals
values in [0,1]. The resulting interpolated color will be value*oneColor + (1-value)*zeroColor, in Lab space.
zeroColor
the "zero bound" color, in any valid R color format (e.g. "yellow", "#00FF00", ...)
oneColor
the "one bound" color, in any valid R color format (e.g. "yellow", "#00FF00", ...)

Value

a vector of RGB colors in string format, e.g. "#BBFF00".

See Also

drawGradient

Examples

Run this code
res <- getInterRGB(runif(10), "yellow", "red")

Run the code above in your browser using DataLab