Color space math for TrueColor: RGB/HSL/HSV/XYZ/Lab conversions and luminance calculations.
Summary
Functions
Converts HSL (h in 0..360, s/l in 0..1) to normalized RGB (0..1 each).
Converts HSV (h in 0..360, s/v in 0..1) to normalized RGB (0..1 each).
Calculates relative luminance for an 8-bit RGB color (WCAG formula).
Converts normalized RGB (0..1 each) to HSL tuple {h, s, l} where h is 0..360, s and l are 0..100.
Converts normalized RGB (0..1 each) to HSV tuple {h, s, v} where h is 0..360, s and v are 0..100.
Converts an 8-bit RGB struct to XYZ color space.
Converts XYZ to CIELAB (L, a, b*) using D65 illuminant.
Functions
Converts HSL (h in 0..360, s/l in 0..1) to normalized RGB (0..1 each).
Converts HSV (h in 0..360, s/v in 0..1) to normalized RGB (0..1 each).
Calculates relative luminance for an 8-bit RGB color (WCAG formula).
Converts normalized RGB (0..1 each) to HSL tuple {h, s, l} where h is 0..360, s and l are 0..100.
Converts normalized RGB (0..1 each) to HSV tuple {h, s, v} where h is 0..360, s and v are 0..100.
Converts an 8-bit RGB struct to XYZ color space.
Converts XYZ to CIELAB (L, a, b*) using D65 illuminant.