The “dark yellow problem” in design system color palettes
medium.com
medium.com
WCAG 3 is moving to APCA (Advanced Perceptual Contrast Algorithm) which will be much more fair to cases covered in this post. Yes, there'll still be perceptual contrast issues with dark yellow, but I'd wager that the solutions you'll land on when measuring with APCA will be less drastic or visually unappealing.
More on APCA: https://typefully.com/u/DanHollick/t/sle13GMW2Brp
(Calculation: (61 / 47) / (2.9 / 4.5) = 2.014)
The maximum saturation occurs at a different lightness value for each hue. Blue is most saturated when it is dark, and yellow is most saturated when it is light. It is for this reason that some people erroneously describe yellow as being a bright Colour.
To added even further perversity to the mix, there are fewer (perceivable) yellows than there are perceivable greens. Relative perceivable values of hues are readily apparent in the Munsell Colour space, shown here:
https://i.pinimg.com/originals/4b/43/84/4b438408b064533fc862...
Moral of the story? Colour is difficult.
As a designer, colour models like RGB, Lab, CMTK and hex are of instruments of application. All well and good, but if you want a colour model that is suitable for thinking about colors with, then HSL (or HSV) is the only option.
As an exercise, I get my students to define the difference between color pairs using HSL. Even high school students can do it. Try that with RGB!
color spaces definitely defy straightforward intuition about them.
Thanks for introducing me to OKLAB.
> From my perspective that hue is the independent variable to set first
Agreed.
> Color spaces definitely defy straightforward intuition about them.
You are aware of Kuehnis book "Color space and its divisions."? It is a great read on this fascinating subject.
i haven't read that book, but i'll have to check it out!
This was known long ago--it's called the Rule of Tinctures in heraldry, which says that yellow and white (sometimes rendered as gold and silver) should only appear on red, green, blue or black, and vice versa.
Edit: I realize this might come off as trivializing the author, which I didn't mean to do. I just think it's interesting that different groups have come up with the same rules over time.
Also, yes, handling of colors and color combinations is a very old topic, just that this knowledge isn't given to us by birth, but through learning. Which means there will always be someone stumbling over this and make another post delving into (some of) the details. As long as it brings others up to speed, I count this as a net win. One can just hope that the history isn't lost entirely eventually ...
The Stripe tool mentionned at the end does draw some inspiration from this, and i would really like for Stripe to open source this tool. I have asked multiple times, to no answer. If someone from Stripe is reading this, please please please make the world better for everyone out there by releasing this tool.
> Unfortunately, there seems to be no satisfactory color palette generator yet capable of fine-tuning and creating themable ramps
Personally, I want some website where I can chuck a color in or pick from a preset list, and it shows me HTML elements pre-styled with suggested color ramp colors (for example input{background:var(--theme-bg-2);}). Then I can see what I'm getting and inspect element to take what I need.
This tool could be built but noone want to pay for it.
One challenge I have run into is that certain kinds of accessibility accommodations may only be necessary for a tiny fraction of your user base who have a specific type of vision, motor, or auditory deficiency. Unless you specifically recruit and test with those users the issues may not be revealed by usability tests.
And, there's just a little hope they're revealed with math. I have someone that requires 100% contrast, which is the requirement if you want to include the tails of the distribution.
The main issue is that they linearise the sRGB colour space before adding together the components… and then never 'delinearise' it afterwards. Human brightness perception is non-linear and WCAG totally ignores it.
This is a collection of 'even' black-white gradients in different colour spaces.
https://docs.krita.org/en/_images/trc_gray_gradients.svg
LAB is pretty much the standard for a perceptually even colour space.
The sRGB gamma curve was chosen based on CRT mechanics… but it’s pretty close.
The WCAG calculations only make sense in a world where 'Linear TRC' is perceptually even.
If you don't want the weird perceptual emphasis inversions of yellow, maybe don't use yellow?
The article points out the commonly held reason to use it is the "traffic color patterns", but it is easy to forget that early traffic lights intentionally put the highest emphasis/most "alert" color in the middle, because that is the shortest and most dangerous phase and needs the most attention. Plus, as other comments keep pointing out even modern traffic lights in most countries today think yellow is too strong an emphasis color and have shifted towards amber/orange.
I'm currently kludging - using CAM16UCS within sRGB gamut, but outside, where it gets badly hue nonlinear, I'm "straighten it up a bit" using Jzazbz, slightly fluffing out the visible gamut. And then packaging that as lookup tables.
For pedagogically nice, let's say "looks plausible" and "isn't grossly misleading". So a wide-gamut perceptual space, with large-scale euclidean distances at least eyeball plausible, not-too-dreadful hue linearity, and avoids high-profile space features which are mere model artifact and not perception characteristic. Sort-scale distance is much less important, and computability not at all.
Root-motivation backstory is I'm struggling to find community, around a philosophy of science education content creation, that collaboratively applying vastly greater-than-usual domain expertise is needed to escape current wretchedness. And thought a worked example might help. So web interactives for teaching color, emphasizing spectra and color space, for early primary. Where color is commonly taught, but with content and outcomes notably poor, even by science education standards. I'm still not sure it will gell, but wiggle-3D voxel space with xkcd color names, banana spectra, video cartoon shaders, zooming to physical pixels, et al, has at least been fun. Though low-hanging MVP it so isn't.
I was familiar only with the green color name from 80s fashion, until I became mildly interested in cocktails...