A pragmatic set of modern colour space transforms
colourspace provides correct, minimal colour space transforms optimised for UI frameworks and creative tooling, covering OkLCh, OkLab, sRGB, Display P3, Rec. 2020, and Rec. 2100. Transforms are direct matrix multiplications with pre-computed matrices derived with tools/builder.odin. Perceptual manipulation and colour appearance work uses OkLab as the working space.
Gamut mapping is explicitly out of scope. Out-of-gamut values are passed through as-is, and handling is left to the caller — typically shader-side in a display pipeline.
Rec. 2020 and Rec. 2100 spaces along with Rec. 709, Perceptual Quantizer and Hybrid Log-Gamma transfer functions can be enabled with: -define:COLOURSPACE_ENABLE_HDR