spectrumcolors {cooltools}R Documentation

Spectrum colour palette

Description

Generates smooth rainbow color scale from red to purple, similar to rainbow, but with improved smoothness

Usage

spectrumcolors(n, alpha = 1, rev = FALSE)

Arguments

n

integer number of colors in the scale

alpha

alpha transparency value (0=fully transparent, 1=fully opaque)

rev

logical flag indicating whether the ordering of the colors should be reversed

Value

Returns an n-vector of RGB colour strings.

Author(s)

Danail Obreschkow

#' @examples nplot() rasterImage(rbind(spectrumcolors(1e3)),0,0,1,0.5) rasterImage(rbind(rainbow(1e3,end=5/6)),0,0.5,1,1) text(0.5,0.25,'spectrum') text(0.5,0.75,'rainbow') abline(h=0.5)


[Package cooltools version 2.4 Index]