Local-first, alwaysA little guidance ↗

THE SMALL PRINT, MADE READABLE

Color, with the working shown

Color space and precision

Stored palette colors are opaque 8-bit sRGB HEX values under the D65 white point. Calculations use double precision, with rounding only at display or sRGB export. HEX, RGB, HSL and OKLCH input is supported; alpha, CMYK, ICC-managed print and wide-gamut exports are not.

OKLab and gamut mapping

Conversions follow Björn Ottosson's OKLab matrices. For out-of-sRGB OKLCH inputs, a 28-iteration bisection reduces chroma at constant requested lightness and hue. This is our strict-boundary mapping, not the CSS local-MINDE algorithm. 8-bit quantization can slightly change the final coordinates.

Contrast: formal WCAG ratios

Contrast uses the WCAG 2.2 relative-luminance formula, including the 0.04045 sRGB linearization threshold. Pass/fail uses the unrounded ratio. AA normal text requires 4.5:1; AA large text 3:1; AAA normal text 7:1; AAA large text 4.5:1. Large text is at least 24px regular or approximately 18.67px bold. A contrast pass is not a complete accessibility audit.

Contrast repair

Repair searches 1,001 lightness values in both directions, mapping each to sRGB and checking the resulting HEX ratio. It selects the passing candidate with the least lightness movement. It may reduce chroma, is not a global perceptual-distance optimizer, and reports when no solution exists for the requested target and background.

Vision simulation: an approximation

Protanopia, deuteranopia and tritanopia previews use severity-1.0 matrices from Machado, Oliveira and Fernandes (2009), applied to linear sRGB with output clipping. Grayscale uses relative luminance. These are illustrative approximations, not diagnostic or compliance tests. Individual perception varies.

Image extraction

The browser decodes an image into an sRGB canvas at up to 128 × 128 pixels. Pixels with alpha below 0.5 are ignored. Remaining pixels are clustered with farthest-point initialization and twelve k-means iterations in OKLab. The largest clusters are shown first. Results are approximate, depend on browser image decoding, and may omit small objects.

Gradient interpolation and exports

Modern gradient CSS can interpolate in OKLab; an sRGB fallback is provided first. Gradient text contrast must be evaluated at every position used. Token JSON follows the color-value shape in the DTCG 2025.10 format; integration behavior still depends on the receiving tool. SVG exports contain only normalized colors, without embedded scripts.