Learn R Programming

plotrix (version 3.8-4)

color.gradient: Calculate an arbitrary sequence of colors

Description

color.gradient is now just a call to color.scale with a vector of equally spaced integers (1:nslices). The function is kept for backward compatibility.

Usage

color.gradient(reds,greens,blues,nslices=50)

Value

A vector of hexadecimal color values as used by col.

Arguments

reds,greens,blues

vectors of the values of the color components as 0 to 1.

nslices

The number of color "slices".

Author

Jim Lemon

See Also

rescale,approx,color.scale

Examples

Run this code
 # try it with red and blue endpoints and green midpoints.
 color.gradient(c(0,1),c(1,0.6,0.4,0.3,0),c(0.1,0.6))

Run the code above in your browser using DataLab