colors-functions: Color palettes for imaging

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

Description

Create a vector of n continuous or discrete colors.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
color.map(map = c("redblack", "greenblack", "blueblack",
    "viridis", "cividis", "magma", "inferno", "plasma",
    "rainbow", "darkrainbow", "grayscale",
    "jet", "hot", "cool"), n = 100)

col.map(...)

intensity.colors(n = 100, alpha = 1)

jet.colors(n = 100, alpha = 1)

divergent.colors(n = 100, start = "#00AAEE",
    middle = "#FFFFFF", end = "#EE2200", alpha = 1)

risk.colors(n = 100, alpha = 1)

gradient.colors(n = 100, start = "#000000",
    end = "#00AAFF", alpha = 1)

bw.colors(n = 100, alpha = 1)

discrete.colors(n = 2, chroma = 150, luminance = 65, alpha = 1)

alpha.colors(col, n = 100,
    alpha = (seq_len(n)/n)^alpha.power,
    alpha.power = 2)

darkmode(default = TRUE)

lightmode(default = TRUE)

Arguments

map

the name of the colormap

n

the number of colors

...

arguments passed to color.map()

alpha

a vector of alpha values between 0 and 1

start

the start color value

middle

the middle color value

end

the end color value

chroma

the chroma of the color

luminance

the luminance of the color

col

the color(s) to expand with transparency

alpha.power

how the alpha should ramp as it increases

default

Should this be set as the default plotting mode?

Details

Most of these functions return a vector of colors.

Several of the options made available by color.map are borrowed from the viridisLite package, including 'viridis', 'cividis', 'magma', 'inferno', and 'plasma'. The original functions for these color palettes are also re-exported for use by users. See the documention for them in that package.

The darkmode and lightmode functions change the graphical parameters for the current graphics device accordingly. The new themes will be used for any subsequent plots.

Value

A palette of colors.

Author(s)

Kylie A. Bemis

See Also

viridis, cividis, magma, inferno, plasma

Examples

1
2
3
col <- gradient.colors(100^2)
if ( interactive() )
	image(matrix(1:(100^2), nrow=100), col=col)

Cardinal documentation built on Nov. 8, 2020, 11:10 p.m.