Skip to content

Color

Conversion helpers between common color spaces. All helpers operate on plain numeric tuples — RGB and HSL/HSV are returned as [a, b, c] arrays, hex values are strings prefixed with #.

Conversions

Internals

  • hueToRGB — low-level helper used by hslToRGB for converting a hue component to its RGB value.

Conventions

  • RGB components are integers in the range 0..255.
  • Hue is in degrees 0..360 (or normalized 0..1 when used with hsvToRGB).
  • Saturation and lightness/value are percentages 0..100 for HSL/HSV inputs as documented per function.
  • Hex strings use the short #rrggbb form with a leading #.