extract_hcl: Extract HCL components

View source: R/extract.R

clr_extract_chromaR Documentation

Extract HCL components

Description

Extract the hue, chroma, or luminance color components from a vector of colors.

Usage

clr_extract_chroma(col)

Arguments

col

A colors object (see color()) or a vector of any of the three kinds of R color specifications, i.e., either a color name (as listed by grDevices::colors()), a hexadecimal string (see col2rgb()), or a positive integer i meaning grDevices::palette()⁠[i]⁠.

Details

The range of the value are:

  • Hue is ranging from 0 to 360.

  • Luminance is ranging from 0 to 100.

  • Chroma, while dependent on hue and luminance, will roughly be within 0 and 180.

Use clr_extract() if you are planning to extraction multiple components.

Value

Numeric vector of values.

See Also

Other Extraction: clr_extract(), clr_extract_hue(), extract_rgba()

Examples

clr_extract_hue(rainbow(100), "HCL")
clr_extract_chroma(rainbow(100))
clr_extract_luminance(rainbow(100))

EmilHvitfeldt/prismatic documentation built on Nov. 23, 2024, 10:41 a.m.