Explore a constant-lightness plane of OKLab (which includes out of gamut colors, and indeed imaginary colors), mapped to sRGB using (on the left) the proposed new CSS Color 4 GMA which operates in OKLCH with detaEOK and avoids un-needed deltaE calls.
In the middle, simple coordinate clipping (fast, but severe hue and lightness shifts).
Compared to (on the right) current color.js gamut mapping algorithm, which operates in CIE LCH with deltaE 2000.
|OKLCH, ΔEOK||Clip||CIE LCH, ΔE2000|
Typical gamut mapping times (mean over for 2,500 mappings ie a 50 x 50 grid):