Description Usage Arguments Details Value Functions See Also Examples
These palette functions transform all-numeric colour_spec
vectors into
colours.
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)
|
x |
An |
min, max |
A |
The conversion from colour_spec
vectors to colour is powered by
the farver::encode_colour()
function.
A character
vector of the same length as the x
argument with
hexadecimal colour notation.
rgb_palette
: Red, Green and Blue colour space.
hsv_palette
: Hue, Saturation and Value colour space.
hsl_palette
: Hue, Saturation and Lightness colour space.
hcl_palette
: Hue, Chroma and Luminance colour space.
cmyk_palette
: Cyan, Magenta, Yellow and Key (black) colour
space.
cmy_palette
: Cyan, Magenta and Yellow colour space.
lab_palette
: Lightness*, a* (green-red axis), b*
(blue-yellow axis) colour space. Also known as CIE L*ab.
lch_palette
: Lightness*, Chroma*, Hue-angle colour
space. Also known as CIE LCh.
oklab_palette
: An OK Lightness, a (green-red axis), b
(blue-yellow axis) colour space. Also known as OKLab. Needs farver package
version \>2.0.3.
oklch_palette
: An OK Lightness*, Chroma*, Hue-angle colour
space. Also known as OKLch. Needs farver package version \>2.0.3.
The colour_spec page for building colour space vectors. The scale_chromatic page for the scales wherein these palettes are used.
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))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.