Learn R Programming

Cardinal (version 1.4.0)

intensity.colors: Color Palettes for Imaging

Description

Create a vector of n continuous colors.

Usage

intensity.colors(n, alpha=1) risk.colors(n, alpha=1) gradient.colors(n, start="white", end="black", alpha=1) alpha.colors(n, col="red", alpha.power=2, alpha=(seq_len(n)/n)^alpha.power)

Arguments

n
the number of colors
alpha
a vector of alpha values between 0 and 1
start
the starting color value
end
the ending color value
col
the color(s) to expand with transparency
alpha.power
how the alpha should ramp as it increases

Value

A pallete of colors.

Examples

Run this code
col <- intensity.colors(100^2)
if ( interactive() ) {
	image(matrix(1:(100^2), nrow=100), col=col)
}

Run the code above in your browser using DataLab