TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Accessible Palette: stop using HSL for color systems (2021)

323 pointsby bpierreover 1 year ago

24 comments

PaulHouleover 1 year ago
Nice!<p>I&#x27;d point out though that with ordinary display and print systems, saturated reds and blues really are darker than greens. The exact formula depends on your color space but<p><pre><code> Grayscale = 0.299R + 0.587G + 0.114B [1] </code></pre> is commonly quoted (I think for sRGB) and in that case the brightest pure red is about 30% bright and the brightest pure blue is 11% which makes &quot;bright red&quot; an oxymoron in most cases.<p>You can certainly use those colors but they are always going to be dark. Simply applying contrast rules will make your color choices accessible but if you want to make something accessible and that look good the techniques in that article will make you a winner.<p>For that matter, saturated screen greens are nowhere near as saturated as is possible but are more saturated than most greens you see in real life: I make red-cyan stereograms<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Anaglyph_3D" rel="nofollow noreferrer">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Anaglyph_3D</a><p>and one rule of thumb is that trees and grass look great in stereograms because even though they are green, they actually have a lot of red so the balance between the channels is good so you get good stereo <i>and</i> good color.<p>[1] <a href="https:&#x2F;&#x2F;www.dynamsoft.com&#x2F;blog&#x2F;insights&#x2F;image-processing&#x2F;image-processing-101-color-space-conversion&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.dynamsoft.com&#x2F;blog&#x2F;insights&#x2F;image-processing&#x2F;ima...</a>
评论 #37308934 未加载
评论 #37349737 未加载
bandergirlover 1 year ago
&gt; In practice, samples meeting the WCAG 2.1 recommendations are harder to read than those with an “insufficient” contrast ratio.<p>Happy to see I’m not the only one. This has been bugging me for a long time, how an “accessibility guidance” formula actually had the opposite effect. Why was that standardized?
评论 #37310103 未加载
评论 #37313578 未加载
zX41ZdbWover 1 year ago
The best article I&#x27;ve seen on this topic is <a href="https:&#x2F;&#x2F;www.handprint.com&#x2F;HP&#x2F;WCL&#x2F;color1.html" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.handprint.com&#x2F;HP&#x2F;WCL&#x2F;color1.html</a><p>Warning: super-long read, you will spend a day.<p>You&#x27;ll be surprised, but I use some thoughts from this article in ClickHouse to color logs nicely: <a href="https:&#x2F;&#x2F;github.com&#x2F;ClickHouse&#x2F;ClickHouse&#x2F;blob&#x2F;master&#x2F;base&#x2F;base&#x2F;terminalColors.cpp#L11C32-L11C32">https:&#x2F;&#x2F;github.com&#x2F;ClickHouse&#x2F;ClickHouse&#x2F;blob&#x2F;master&#x2F;base&#x2F;ba...</a>
评论 #37314021 未加载
jjcmover 1 year ago
I had the pleasure of meeting Eugene during Figma&#x27;s Config conference where he gave a ton of similar pro tips to designers. Really a kind dude who truly has a passion for design and accessibility.<p>One thing I&#x27;ll give a big shout out to in this article is APCA, which will likely be a successor to WCAG 2&#x27;s color contrast algorithm. We used it internally here at Figma for our own accessibility revamp for a final result that ended up much better than it would have otherwise. Eugene provides some great examples of when WCAG 2 fails, and we were continually running into those.<p>That really brings me to my main piece of advice here: color is really hard to get right - any tool you have can help you along the way, but that said at some point you also have to trust your eye. At the end of the day, all of these tools are just providing some mathematical approximation for how your eye sees color. Your eye is the final source of truth, not the algorithms. If you&#x27;re encountering areas where a tool or an algorithm aren&#x27;t providing you the right result, switch it around or fall back to basics.
评论 #37311705 未加载
评论 #37317077 未加载
refulgentisover 1 year ago
Friendly plug for HCT -- it&#x27;s a color space I built to enable Material You, it weds the lightness measure mentioned here to the latest and greatest color science space --- LAB&#x2F;LCH is from 1976!<p>It makes design more intuitive, they only need to know that a 40 difference in &#x27;T&#x27; ensures that WCAG standards for buttons are met, and a difference of 50 meets the standards for text.
评论 #37311274 未加载
评论 #37314013 未加载
评论 #37311730 未加载
zokierover 1 year ago
In addition to missing oklab&#x2F;oklch, the article is also wrong in claiming web&#x2F;css supports only srgb; css color() function supports many colorspaces
评论 #37310534 未加载
评论 #37309881 未加载
评论 #37310132 未加载
评论 #37317037 未加载
hrydgardover 1 year ago
oklab might be an even better alternative to LCh:<p><a href="https:&#x2F;&#x2F;bottosson.github.io&#x2F;posts&#x2F;oklab&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;bottosson.github.io&#x2F;posts&#x2F;oklab&#x2F;</a>
评论 #37308305 未加载
评论 #37312405 未加载
评论 #37308354 未加载
评论 #37308214 未加载
bee_riderover 1 year ago
If the CIELAB numbers are based on perceptual changes, how do they interact with accessibility? Do we need to worry that these perceptual formulae might be based on standard vision? Could they be different for different types of color blindness, or is that not a thing. (FWIW, I try to make my charts as accessible as possible, but I’m totally uneducated in color stuff, so I’m limited to just following advice, can’t derive anything—there’s every possibility that this is a dumb question!)
评论 #37310171 未加载
cptcobaltover 1 year ago
This article puts the description of it at the bottom, but APCA Contrast—which is the readable contrast test in the WCAG 3 Draft Standard—is much more fair to some colors than WCAG 2.1&#x27;s Contrast Ratio was.<p>Good reading for the color theory behind perceptual contrast: <a href="https:&#x2F;&#x2F;www.smashingmagazine.com&#x2F;2022&#x2F;09&#x2F;realities-myths-contrast-color&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.smashingmagazine.com&#x2F;2022&#x2F;09&#x2F;realities-myths-con...</a><p>And a distilled description of APCA: <a href="https:&#x2F;&#x2F;typefully.com&#x2F;u&#x2F;DanHollick&#x2F;t&#x2F;sle13GMW2Brp" rel="nofollow noreferrer">https:&#x2F;&#x2F;typefully.com&#x2F;u&#x2F;DanHollick&#x2F;t&#x2F;sle13GMW2Brp</a>
评论 #37309999 未加载
tempodoxover 1 year ago
So, where&#x27;s the code? I want an algorithm that I can use in any software, not a web form.
评论 #37309518 未加载
评论 #37316632 未加载
Springtimeover 1 year ago
Came across an article when looking into this issue, about HSY[1] from a Krita (image editor) dev, which is apparently part of Krita&#x27;s advanced color selector and addresses the same issue by mapping perceived luminosity of colors.<p>[1] <a href="https:&#x2F;&#x2F;wolthera.info&#x2F;2014&#x2F;07&#x2F;hsi-and-hsy-for-kritas-advanced-colour-selector&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;wolthera.info&#x2F;2014&#x2F;07&#x2F;hsi-and-hsy-for-kritas-advance...</a>
ichikover 1 year ago
(2021) should be added to the title, many commenters seem to be oblivious to that fact.
vladstudioover 1 year ago
if you&#x27;re interested in the topic, a nice article was just published in Smashing Magazine about Oklch:<p><a href="https:&#x2F;&#x2F;www.smashingmagazine.com&#x2F;2023&#x2F;08&#x2F;oklch-color-spaces-gamuts-css&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.smashingmagazine.com&#x2F;2023&#x2F;08&#x2F;oklch-color-spaces-...</a>
评论 #37310322 未加载
jamal-kumarover 1 year ago
Does anyone know off hand how we test whether or not tetrachromats are able to truly see more colours than your average person? Not just like the x-rite or whatever but maybe something that&#x27;s more advanced than that which goes in the kind of direction that these more advanced colour space profiles seem to cover? I pass that test really easily but I really doubt I have more cones in my eyes or any of that.
评论 #37316238 未加载
lelandbateyover 1 year ago
I&#x27;m so excited to see more work in the perceptually uniform color-choice space. I first saw this discussed by Stripe in 2019, but the work with &quot;accessible pallets&quot; is a revolution!<p><a href="https:&#x2F;&#x2F;stripe.com&#x2F;blog&#x2F;accessible-color-systems" rel="nofollow noreferrer">https:&#x2F;&#x2F;stripe.com&#x2F;blog&#x2F;accessible-color-systems</a>
sphover 1 year ago
What about HSLuv?<p><a href="https:&#x2F;&#x2F;www.hsluv.org&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.hsluv.org&#x2F;</a>
评论 #37311593 未加载
AtNightWeCodeover 1 year ago
I created a game editor some years ago that had several HSL alternatives including one contrast corrected bar and two different light&#x2F;shadow corrected bars. I used it mostly the other way around though. Creating suggestive backgrounds with many colors but with low contrast between them.
chiefalchemistover 1 year ago
I&#x27;m not a trained designer, and for that reason I would never attempt to design a color system with six different colors, and then shades &#x2F; tones within each. Is that not overkill and unnecessary?<p>Mind you, I appreciate the suggestion to avoid Tool X (i.e., in this case HSL) but I can&#x27;t help but believe they did themselves a disservice by choosing a six-color color system to begin with. In my eyes, mind and heart accessiblity and simplicity go hand in hand.<p>Fact: There&#x27;s not a user in the world who wakes up and thinks &quot;My day will be made if and only if I visit a site with an overly complicated color system.&quot;
评论 #37311617 未加载
评论 #37309297 未加载
darklycan51over 1 year ago
I love websites getting uglier and uglier due to forced &quot;accesibility&quot; colors, how about you give me a color palette? I want my color palettes to be like a 90s RPG, fully radioactive colors, I can see better if colors are brighter, I don&#x27;t want dull&#x2F;boring colors, I literally turn off darcula and switch to high contrast&#x2F;terminal colors with bright green on my IDE for a reason.
评论 #37317881 未加载
dmarinusover 1 year ago
I use HSL to set the color of my keyboard leds during the day. For that purpose it&#x27;s really great because it gives nice bright colors contrary to cielab which give many dull colors (like visible in the blog post).
1-6over 1 year ago
This is only applicable against a white background. Do the same rules apply for a black background or other colors?
eviksover 1 year ago
As this blog and the app demonstrate, we haven&#x27;t even progressed past the inscrutable hex codes
xmonkeeover 1 year ago
Oof, what a great article. Fucking saved.
hosejaover 1 year ago
A truly correct color system would precisely describe the spectrum of whatever color you&#x27;re communicating, interpreting the mangling eyeballs do to it left as an exercise to the reader.
评论 #37308630 未加载
评论 #37308771 未加载
评论 #37311691 未加载