spectrumcolors: Spectrum colour palette

Description Usage Arguments Value Author(s)

View source: R/spectrumcolors.R

Description

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

Usage

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


graphx documentation built on Feb. 3, 2022, 5:07 p.m.