colr: Create a Range of Colors

Description Usage Arguments See Also Examples

View source: R/colr.R

Description

Create a range of colors between two specified colors.

Usage

1
colr(x, fromcolname, tocolname)

Arguments

x

A numeric vector, the values to be assigned colors.

fromcolname

A character or numeric scalar, indicating the color to use for the lowest value in x. Either a color name (as listed by colors(), a hexadecimal string of the form "#rrggbb" or "#rrggbbaa" (see rgb), or a positive integer i meaning palette()[i].

tocolname

A character or numeric scalar, indicating the color to use for the highest value in x. See fromcolname.

See Also

colors, palette.

Examples

1
2
x <- 1:10
plot(x, x, pch=16, col=colr(x, "blue", "yellow"), cex=4)

JVAdams/jvamisc documentation built on Aug. 11, 2021, 6:43 a.m.