pal.rainbow: Rainbow palette

View source: R/pal_rainbow.R

pal.rainbowR Documentation

Rainbow palette

Description

The pal.rainbow function produces a color palette adapted to dose representation.

Usage

pal.rainbow(n, alpha = seq(0.8, 0, length.out = n))

Arguments

n

Integer, number of colors to be in the palette

alpha

Vector representing the opacity, in the range of 0 (transparent) to 1 (opaque). If alpha = NULL, all colors are opaque.

Value

Returns a color-labeled vector of size n.

Examples

pal <- pal.rainbow(255)

image(x = seq(0, 70, length.out = 255), y = 1,
      z = matrix(seq(0, 70, length.out = 255), ncol = 1),
      col = pal,
      main = "Rainbow colors")

espadon documentation built on May 8, 2026, 9:07 a.m.