get_color: Get and interpolate colors

Description Usage Arguments Details Value See Also Examples

View source: R/get_color.R

Description

Get and interpolate colors

Usage

1

Arguments

col

color name in the rcolors or a vector of colors

n

Integer, default is length of col

show

Boolean, whether to visualize those colors?

Details

supported col names: 270 ncl colors (names(rcolors)) and 35 RColorBrewer colors (names(colors_group$brewer)).

Value

A character vector with elements of 7 or 9 characters, "#" followed by the red, blue, green and optionally alpha values in hexadecimal (after rescaling to 0 ... 255). The optional alpha values range from 0 (fully transparent) to 255 (opaque).

R does not use ‘premultiplied alpha’.

See Also

show_cols()

Examples

1
2
3
print(names(rcolors[1:6]))
print(names(colors_group$brewer))
get_color("amwg_blueyellowred", n = 20)

rcolors documentation built on April 23, 2021, 5:07 p.m.