[Cuis-dev] Oklab color space and Oklch

Luciano Notarfrancesco luchiano at gmail.com
Sun Nov 30 07:44:48 PST 2025


I've been playing with colors and found out about this color space.
https://en.wikipedia.org/wiki/Oklab_color_space

I'm sharing it in case anyone wants to play with this too. I implemented
the two methods to create colors from parameters in this color space. It
seems to be modern thing to use (see
https://evilmartians.com/chronicles/oklch-in-css-why-quit-rgb-hsl for
example). It makes it easy to generate palettes varying only the hue
without changing perceived lightness (and changing chroma minimally if it
doesn't fit in the sRGB gamut). For example, try:

step := 360 / 10.0.
0 to: 360 - step by: step :: collect: [:h| ColoredBoxMorph new color:
(Color okl: 0.75 c: 0.4 h: h)]

Cheers,
Luciano
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20251130/8a7d33ae/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Color#class-oklchsRGBDo.st
Type: application/octet-stream
Size: 1287 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20251130/8a7d33ae/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Color#class-oklch.st
Type: application/octet-stream
Size: 1270 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20251130/8a7d33ae/attachment-0001.obj>


More information about the Cuis-dev mailing list