Calculation methodology
All color processing runs locally in the browser through a typed, tested wrapper around Color.js. UI components do not contain independent color formulas.
Conversion and gamut mapping
CSS colors are parsed into OKLCH. Device-space output is mapped with the CSS Color 4 chroma-reduction method. Naive channel clipping is available only in the gamut visualizer for comparison.
Contrast
Foreground and background alpha are composited over the selected opaque canvas before WCAG 2.1 and experimental APCA values are calculated. Accessible suggestions use a target-gamut binary search and Delta E 2000 to choose the closest result.
Palette generation
Lightness follows an anchored nonlinear curve. Chroma peaks near the anchor and tapers at the ends; optional hue drift can compensate across the ramp. Every stop is mapped to the selected gamut and reports contrast and adjacent Delta E.
Bulk CSS conversion
Stylesheets and declaration values are parsed structurally. Strings, comments, URLs, variables and SVG data remain untouched. Optional fallback mode preserves the original declaration before the OKLCH declaration.