Get vibrant reference color for a given HCL color hue

vibrant_color_by_hue(h, C = 60, S = 100, L = 50)

Arguments

h

numeric color hue in the range c(0, 360).

C, S, L

numeric values used during the color conversion:

  • C is the intermediate HCL color chroma

  • S is the HSL color saturation

  • L is the HSL lightness

...

additional arguments are ignored.

Value

character vector of colors for each hue h.

Details

This function converts each h HCL hue to a hex color using jamba::hcl2col(). This hex color is converted to HSL color space using jamba::col2hsl(), so the color saturation and lightness can be adjusted to full saturation without going outside the HCL color gamut. This HSL color is converted back to hex color format.

The reason for the two-step conversion is to honor the HCL color hue, which is not the same numeric value as used by the HSL color space.

See also