Color icon indicating copy to clipboard operation
Color copied to clipboard

Adding support for Oklab and Oklch

Open DrewFenwick opened this issue 1 year ago • 1 comments

In 2021, the Oklab and Oklch color spaces were included in the CSS Color Level 4 and Level 4 drafts and support has since been implemented in all major web browsers.

Oklab was introduced by Björn Ottosson in December 2020 by this blog post, and it is broadly similar to CIE Lab but purported to have improved perceptual qualities, in particular CIE Lab is worse at predicting hues, particularly blue hues.

Oklch is to Oklab what CIE LHC is to CIE Lab: the polar version of Oklab. It isn't set out in Björn's blog post but is documented (along with Oklab) in the CSS Color Level 4 draft

I figure support by major web browsers gives these color spaces enough weight to warrant support.

DrewFenwick avatar Nov 28 '24 16:11 DrewFenwick

@DrewFenwick Oklab looks very interesting and something we should definitely implement. I might be able to get to it a bit later this month towards the holidays. You are welcome to submit a PR if you wanna give it a try yourself before then.

lehins avatar Dec 03 '24 19:12 lehins

Made a release to hackage with this addition: https://hackage.haskell.org/package/Color-0.4.1 Many thanks to @iteratee for implementing this new color space.

lehins avatar Oct 20 '25 21:10 lehins