colors: Various color palettes.

Description Usage Arguments Details See Also Examples

Description

Create vectors of n contiguous colors.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
rwb_colors(n, alpha = 1, s = 0.9, v = 0.9)

rwb.colors(n, alpha = 1, s = 0.9, v = 0.9)

rwg_colors(n, alpha = 1, s = 0.9, v = 0.9)

rwg.colors(n, alpha = 1, s = 0.9, v = 0.9)

ryg_colors(n, alpha = 1, s = 0.9, v = 0.9)

ryg.colors(n, alpha = 1, s = 0.9, v = 0.9)

cwm_colors(n, alpha = 1, s = 0.9, v = 0.9)

cwm.colors(n, alpha = 1, s = 0.9, v = 0.9)

Arguments

n

The number of colors (>= 1) to be in the palette.

alpha

The alpha transparency, a number in [0, 1], see argument alpha = in [hsv()].

[0, 1]: R:0, [hsv()]: R:hsv()

s

The 'saturation' to be used to complete the HSV color descriptions.

v

The 'value' to use for the HSV color descriptions.

Details

cwm_colors(s = 0.5, v = 1) gives very similar colors to cm.colors(). ryg_colors() is similar to rainbow(start = 0, end = 2/6). The xxx_colors() (tidyverse name-compatible) and 'xxx.colors()“ (grDevices name-compatible) functions are synonyms.

See Also

cm.colors(), colorRampPalette()

Examples

1
2
3
4
5
6
7
# Draw color wheels with various palettes
opar <- par(mfrow = c(2, 2))
pie(rep(1, 11), col = cwm.colors(11), main = "Cyan - white - magenta")
pie(rep(1, 11), col = rwb.colors(11), main = "Red - white - blue")
pie(rep(1, 11), col = rwg.colors(11), main = "Red - white - green")
pie(rep(1, 11), col = ryg.colors(11), main = "Red - yellow - green")
par(opar)

SciViews documentation built on Nov. 17, 2019, 1:06 a.m.