colourspace_palettes: Colour space palettes

Description Usage Arguments Details Value Functions See Also Examples

Description

These palette functions transform all-numeric colour_spec vectors into colours.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
rgb_palette(x, min = 0, max = 1)

hsv_palette(x, min = 0, max = 1)

hsl_palette(x, min = 0, max = 1)

hcl_palette(x, min = 0, max = 1)

cmyk_palette(x, min = 0, max = 1)

cmy_palette(x, min = 0, max = 1)

lab_palette(x, min = 0, max = 1)

lch_palette(x, min = 0, max = 1)

oklab_palette(x, min = 0, max = 1)

oklch_palette(x, min = 0, max = 1)

Arguments

x

An colour_spec vector with a numeric vector in every channel.

min, max

A numeric(1) specifying the lower and upper limits respectively.

Details

The conversion from colour_spec vectors to colour is powered by the farver::encode_colour() function.

Value

A character vector of the same length as the x argument with hexadecimal colour notation.

Functions

See Also

The colour_spec page for building colour space vectors. The scale_chromatic page for the scales wherein these palettes are used.

Examples

1
2
3
4
5
6
7
8
9
# Getting the colour "red" in different colour spaces
rgb_palette(rgb_spec(1, 0, 0))
hsv_palette(hsv_spec(0, 1, 1))
hsl_palette(hsl_spec(0, 1, 0.5))
hcl_palette(hcl_spec(0.034, 0.995, 0.532))
cmyk_palette(cmyk_spec(0, 1, 1, 0))
cmy_palette(cmy_spec(0, 1, 1))
lab_palette(lab_spec(0.5, 1, 1))
lch_palette(lch_spec(0.53, 0.79, 0.11))

teunbrand/ggchromatic documentation built on Feb. 28, 2021, 10:47 a.m.