rygcb: A better rainbow.

Description Usage Arguments Details Value Note Author(s) See Also Examples

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

1
2
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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 May 23, 2019, 3:02 a.m.