rygcb: A better rainbow.

rygcbR Documentation

A better rainbow.

Description

Produces a rainbow color palette with colors ranging from "red" to "blue" or "magenta". Perceptual uniformity should be superior to R's rainbow.

Usage

rygcb(n)
rygcbm(n)

Arguments

n

Number of color levels

Details

The palette is created using colorRampPalette.

Value

A vector of colors.

Note

The call to colorRampPalette sets space="Lab" and interpolate="spline" with the intent of creating a more perceptually uniform rainbow.

Author(s)

M.L. Peck

See Also

grey256

Examples

plotsp <- function(spectrum) {
	sl <- length(spectrum)
	rgbv <- col2rgb(spectrum)
	plot((0:(sl-1))+0.5, rgbv[1,], type="l", col="red", xlim=c(0,sl),ylim=c(0,300),xlab="Index",ylab="Channel value")
	points((0:(sl-1))+0.5, rgbv[2,], type="l", col="green")
	points((0:(sl-1))+0.5, rgbv[3,], type="l", col="blue")
	grid()
	rect(0:(sl-1), 260, 1:sl, 300, col=spectrum, density=NA)
}
plotsp(rygcb(400))
X11()
plotsp(rygcbm(500))

mlpeck/zernike documentation built on April 19, 2024, 3:16 p.m.