Convert six-digit HEX colors to sRGB RGB channels using base-16 parsing.
Pack sRGB channels into a #RRGGBB hex string.
Transform sRGB values to hue, saturation, and lightness for intuitive theme editing.
Convert HSL cylindrical coordinates back to sRGB for CSS output.
Calculate relative luminance contrast between foreground and background colors.
Compute WCAG relative luminance from sRGB channels.
Find the opposite hue on the color wheel for high-contrast pairs.
Generate three hues evenly spaced 120° apart.
Build palettes from adjacent hues typically ±30° from a seed.
Approximate subtractive print values from additive screen RGB.
Device-independent LAB via XYZ intermediate space (D65).
Matrix multiply linear RGB by sRGB→XYZ transformation matrix.
Map RGB to hue, saturation, and value for picker UIs.
Modern perceptual space: lightness, chroma, hue in OKLab cylindrical form.
Measure perceptual distance between two LAB colors.
Lighten or darken a seed color while preserving hue.
Avoid muddy midpoints by interpolating in perceptual space.
Minimum contrast ratios for Level AA compliance.
Stricter contrast ratios for Level AAA.
Build 50–950 ramps from a brand seed using lightness steps.
Generate Tonal Spot palettes from a seed color.
Composite foreground over background with transparency.
Blend two colors in a specified color space.
Convert encoded sRGB to linear light for math operations.
Encode linear RGB back to sRGB for display.
Rotate all hues in a palette by a fixed angle.
Increase or decrease colorfulness uniformly.
Shift overall brightness without changing hue.
Quantize dominant colors from pixel samples.
Adjust failing pairs toward compliant contrast.