←back to thread

Tailwind CSS v4.0 Beta 1

(tailwindcss.com)
159 points creativedg | 1 comments | | HN request time: 0.212s | source
Show context
atsjie ◴[] No.42211108[source]
They are switching from sRGB to OKLCH.

First time I heard of OKLCH tbh. Anyone know if that is part of a wider adoption trend or is Tailwind pioneering here?

Looking at the examples it does seem to offer some advantages; but was primarily surprised that they now use it as a default.

replies(8): >>42211156 #>>42211286 #>>42211296 #>>42211440 #>>42211454 #>>42211597 #>>42212322 #>>42216625 #
1. bryanrasmussen ◴[] No.42211440[source]
OKLCH has the main advantage of LCH, which is that the numbers make sense, meaning that if you have two colors that are the same lightness they will look like they are the same lightness, because the numbers make sense you can now do programmatic color manipulation - increase lightness by 5 etc. that in the past would have been too difficult to really do (so people would instead just have variables giving the different rgb values and switch them in)

OKLCH just basically exists because there is a hue change from blue to purple in LCH when the lightness goes less which does not match how humans think of these colors (supposedly, don't know if there is any cultural difference)

So in OKLCH the lighter blue does not look purple like it does in LCH, it looks like lighter blue.