DEV Community

Cover image for The New CSS Color Format You Didn't Know You Needed; OKLCH()

The New CSS Color Format You Didn't Know You Needed; OKLCH()

Nathan G Bornstein on January 24, 2024

The other day, I was on uicolors trying to find a suitable color scheme to base a current project's theme off of. The client requested a muted gree...
Collapse
 
moopet profile image
Ben Sinclair

This is really interesting. Having looked through the examples, I wonder if my eyesight is different in some way, because things which the article/tool implies should have the same perceptual lightness to me often look quite different. My eyes are getting old though :)

OKLCH definitely seems like the future. HSL seemed like the future though as well, but people still seem to stick to hex or RGBA, so I guess we'll see how it shakes out. I'm going to use it on my next project though!

My obligatory annoyance: why do so many people write so well about things like colour perception and then make tools which use inaccessible colours, tab stops, and signifiers in their controls? It's really weird but loads of them seem to do it.

Collapse
 
greenteaisgreat profile image
Nathan G Bornstein

That's a really good point you made; there are so many factors at play with all this stuff, that I'm sure there's bound to be hiccups in what it sets out to do sometimes. That also made me think of folks with color-blindness in some shape or form and how those shades would come across to them.

Good food for thought 🤝

Collapse
 
joestrout profile image
JoeStrout

Any chance you could put periods at the end of your sentences, even when it's the last sentence in the paragraph?

The lack of them trips me up every time, and makes it impossible to concentrate on the actual content of what you're saying.

Collapse
 
greenteaisgreat profile image
Nathan G Bornstein

I'm actually really happy you said that. I went back and forth between including them in this post, thinking the flow might be visually better to not have hard stops due to the format on here.

But I agree, it can blend in with everything after a while. Plus, screen-readers might not acknowledge breaks, so it could be one long run-on sentence for folks that use those devices. My future and present self thanks you 🤝

Collapse
 
ben profile image
Ben Halpern

Huh, I had no idea. Thanks for this!

Collapse
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

High five everyone who already used OKLCH ✋

Collapse
 
greenteaisgreat profile image
Nathan G Bornstein • Edited

*me in the corner, unaware of the magic of oklch() *

seriously, i love your content and am so happy i found your account on here. you're a real one 🤝

Collapse
 
best_codes profile image
Best Codes

Awesome and informative article. I knew nothing about this; thanks for writing!

Collapse
 
greenteaisgreat profile image
Nathan G Bornstein

Of course, happy to brain-vomit on any particular topic I find interest on at any given point 😎 and even more grateful that you took the time to read said exclamations
<3<3

Collapse
 
best_codes profile image
Best Codes

No problem! I guess now I will follow you for more good content. :)