Skip to content

heavyrain266/colourspace

Repository files navigation

colourspace

A pragmatic set of modern colour space transforms

Overview

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.

High Dynamic Range (HDR) Support

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

References

Björn Ottosson

International Color Consortium (ICC)

ITU-R (Rec. 2020)

About

A pragmatic set of modern colour space transforms

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Contributors

Languages