Measured accuracy
Every chart on this page is generated from the repository's own
measurement scripts (tools/cusp-accuracy.js,
tools/build-accuracy-data.js) — rerun them yourself. Log scales,
because the differences span orders of magnitude.
Exact vs fitted: distance from the true sRGB gamut boundary
The gamut cusp drives OKLCH gamut mapping. The reference approach (used by @texel/color, colorjs, and the okhsl reference) approximates it with fitted polynomials plus one Halley step; whitepoint solves the boundary cubics exactly. Below: how far each library's claimed cusp sits from its own gamut boundary, per hue, measured with each library's own conversions.
The fit is excellent at most hues (~10⁻⁹) and degrades five orders of magnitude near the sRGB blue corner — precisely where wide-gamut content lands when mapped down, and exactly the region its own code comments flag. The exact solver is flat at float64 limits, every hue, same speed (118 vs 113 ns/op).
Round-trip error, full catalog
Maximum srgb → space → srgb error across 4,000
seeded random colors, for every one of the 42 registry spaces. The bound
enforced in CI is 10⁻⁹; the measured reality sits three to six orders of
magnitude below it.
Iterative inverses (hct) and signal-domain spaces sit slightly above the closed-form pack, exactly as their documented solver tolerances predict. Full table with both fuzz columns and footnotes: README § Verified precision.
Why the gap exists
whitepoint's standing policy is derive, don't transcribe — and solve, don't fit. Matrices are computed from cited primaries at module load (and checked against spec publications in CI); gamut geometry is solved from the channel cubics. Approximations only survive where they are definitional (OKHSL's shaping polynomial, WCAG's historical threshold) — and then they're implemented exactly as cited, quirks documented. The same policy caught the widely-copied stale ProPhoto/Bradford matrices (~10⁻⁵ off spec derivation) that other libraries still ship.