Solving the accessibility palette riddle

Cracking the code with the perceptive power of Delta E.

Christophe Drayton
UX Collective

--

a cartoon illustration with a man standing on top of a rock in front of large multi-colored rainbows, in the style of intricately mapped worlds, calming symmetry, panoramic view
Solving the accessibility palette riddle, by @ups.ai.down, Midjourney

We are biologically unique individuals, identifiable by our fingerprints, DNA, and irises. The cells at the back of our eyes and the brain cells that process what we see are arranged uniquely in each person. I perceive color differently than you, and your perception differs from your partner’s, friends’, and coworkers’.

Biological deficiencies impact each individual in distinct ways. Consider protanomaly, a mild form of red-green color blindness that affects the red perception of 1% of the population; its effects vary in intensity from person to person. Are we talking about an impairment of 60%? 70%? 30%? Are there any concurrent impairments, such as deuteranomaly, which affects up to 5% of the population’s green perception? And to what extent? Does it affect one eye? Or both?

Since we all perceive the world through our unique color prisms, it’s impractical to rely on individual perception for gauging accessibility.

Therefore, what’s left when we remove colors from the picture?

Same image as the hero picture, in black and white.
Black and white version of the hero picture, by @ups.ai.down, Midjourney.

Shades of gray. Contrast.

Light.

Its subset, Relative Luminance, accounts for our inability to process X-rays and infrared — our shared baseline. Therefore, as Colin Shanley explained, contrast is “the distance of luminance between two colors.”

Graph of perceived brightness of the sRGB 12-step color wheel by Colin Shanley in Mixing Colours of Equal Luminance — Part 1. It shows that Yellow, Green, Lime, Teal, and Cyan have naturally high relative luminance, indicating that these colors, at full saturation and brightness, will have low contrast against white.
Graph of perceived brightness of the sRGB 12-step color wheel — Colin Shanley, Mixing Colours of Equal Luminance — Part 1

This concept of distance explains why bright Yellow, Lime, Green, Teal, and Cyan would never work against White: their luminance is too close to one another.

Yellow, lime, green, teal, and cyan colors against white with their respective relative luminance and contrast. It shows a correlation between the high luminance and the low contrast against white.
Yellow, lime, green, teal, and cyan relative luminance and contrast against white.

The amount of perceived light determines Relative Luminance. Therefore, it is easy to believe that modifying a color’s luminosity creates more distance and, thereby, more contrast. But this approach is misguided, as Lea Verou challenged in her LCH article.

Luminosity is a distinct factor from Luminance. Its value stems from another color space, HSL, which, despite being used in contrast checkers, is not perceptually uniform. Eugene Fedorenko, the creator of Accessible Palette, has written an excellent and comprehensive article on this topic.

Visual representation of the color spectrum with their HSL value and their luminosity value against LCH uniform luminance.
The difference between HSL and LCH, visually explained by Adam Argyle in “LCH Luminance vs. HSL Lightness”, in December 2022

Sharpening our tools

HSL does not account for human perception of color. The output of modified Luminosity — the L in HSL — is either a foggy or chalky hue, causing 48% of designers to declare the shades of their accessible palette their number one frustration.

For instance, the only color with a 3:1 contrast to #DFF0D8 (light green) is #4E974F (a darker green), but 225 similar greens match the contrast ratio.

The technique, generating similar colors and testing them against accessibility, is not new: Tanaguru’s Open Source team found the answer in 2016, and even maybe before. Their algorithm uses the Euclidean distance, which looks for similar colors in the RGB space.

However, RGB, too, does not account for human perception of color. To do so, we need to use Delta E 2000. Designed by the International Commission on Illumination (CIE) as an equivalent of the Euclidean distance in the Lab/LCH space, it compares how perceptible the colors are by human eyes.

Therefore, if we search within a range of Lab/LCH colors with Delta E in mind, we should find the closest accessible color, as in the 225 earlier discussed colors.

What is an accessible color palette?

This wiggle room is beneficial when searching for a color that balances original color closeness, accessibility, and brightness. However, this approach, like every single one that exists today, has a significant caveat.

Designers who have experienced the daunting process of creating an accessible color palette can attest to the struggle. First comes the careful selection of the palette, then the accessibility check. What if we had a quicker way to identify which colors meet the guidelines while still exploring harmony?

How to attain accessibility in palettes that call for other hues, say, split-complementary? In other terms: what does an accessible color palette mean? Is it that all colors match the contrast ratio amongst one another? All against the primary or the neutrals? And amongst them, dark or light background?

Visual representation of split-complementary colors: Red 1, Green, and Cyan against neutrals and paired with one another.
Green and Cyan split-complementary colors of Red 1 (#FF0000) against neutrals (#FFF5F5 and #190000) and paired with one another.

Luminance benefit

In the case of Yellow against White: should you decrease Yellow’s relative luminance? Or White’s instead?

Yellow: luminance benefit-example of yellow against white (contrast ratio 1.07:1) and against black (contrast ratio 19.55:1).
Yellow: luminance benefit—example of yellow against white (contrast ratio 1.07:1) and against black (contrast ratio 19.55:1).

Physics and mathematics provide a straightforward answer: if the relative luminance exceeds 60% (or 0.6), a darker color will create more contrast, and vice versa.

I call this luminance benefit, also known as contrast polarity. It’s a derivative of the contrast ratio calculation, and it has been used for decades to determine if a text should appear black or white on a colored background. Adobe Color employs the same in its Contrast Analyzer.

Adobe Contrast screenshot showing luminance benefit in action.
Adobe Contrast Analyzer screenshot showing luminance benefit in action.

Luminance benefit is a helpful indicator in our search for a consistent, accessible color. However, it doesn’t provide guidance on creating harmonious color palettes.

Addressing the issue

Adobe Color relies on the RYB model (Red, Yellow, and Blue as primary colors) used in Art for centuries to calculate color modes. It generates two hues, then shifts into the HSB color space to differentiate saturation and blackness. A simple study shows consistency across the methodology.

Adobe Color Saturation/Blackness calculation diagram on Analogous Harmony Mode, showing that all hues’ saturation decreased by 5, and only one of their variation has their brightness decreased by 9
Adobe Color Saturation/Blackness calculation diagram on Analogous Harmony Mode

Using the same approach and coupling it with a Delta E accessible color search, we can generate hues at a minimum of 3 and 4.5 contrast ratios. These hues can then be tested against the neutrals of the primary color, as rightfully suggested by Open Source Color System.

Diagram showing the minimum contrast to achieve in an accessible color palette (2 hues at 3:1 and 2 variations at 4.5:1)
Diagram showing the minimum contrast to achieve in an accessible color palette (2 hues at 3:1 and 2 variations at 4.5:1)

Accessibility solved? Well, not so fast. This works well with modes that call for subtle degree change on the wheel, such as monochromatic and analogous, as their colors will most likely be paired with neutrals.

Monochromatic, Analogous, and Complementary color palettes based on Red 1 (#FF0000) and their contrast against neutrals (#FFF5F5 off-white red-tinted, and #190000 off-black red-tinted)
Monochromatic, Analogous, and Complementary color palettes based on Red 1 (#FF0000) and their contrast against neutrals (#FFF5F5 and #190000)

But now, let’s look at the Red-Green complementary pair, for instance. Mathematically, this pair achieves a 3:1 contrast. However, it would be a nightmare for anyone with protanopia or deuteranopia.

Adobe addresses this issue in their Color Blind Safe tool to draw the color out of the line of confusion, even though they recognize an “oversimplification of the actual problem.”

Adobe Color Blind Safe screenshot, showing conflict on the Analogous color palette generated by Adobe Color. The hues are red, orange, and magenta. The Adobe Color Blind Safe shows that colors are too close to one another after being simulated for protanopia, deuteranopia, and tritanopia.
Adobe Color Blind Safe screenshot, showing conflict on the Analogous color palette generated by Adobe Color.

Thankfully, in their 2012 paper, Han and Yoo found that, as the a* value of the LAB color space represents the red-green percentage of color and b* the yellow-blueness, an iterative update loop on the b* value was efficient at getting out of the confusion line.

Shifting our perspectives

Their algorithm would generate a Magenta-Green pair instead of a Red-Green. But is it so bad?

Han & Yoo’s confusion-line separation algorithm simulation results for protanopia and deuteranopia, showing an Original image, 2 recolored images, (one for protanopia, one for deuteranopia), and 2 simulated images of the perceived image
Han & Yoo’s confusion-line separation algorithm simulation results for protanopia and deuteranopia — A Novel Confusion-Line Separation Algorithm Based on Color Segmentation for Color Vision Deficiency, Han, Yoo, and Kim, Journal of Imaging Science and Technology, 2012.

The key to an accessible palette is whether or not we need to pair colors together. Therefore, two venues open before us:

  1. use an inclusive color pair, or
  2. use the color against a neutral.

That means maybe we should not try to shoehorn Yellow against White but find a color that complements its shine, such as a Deep Blue.

Example of pairing against a neutral color (Yellow becomes Mustard if paired with White) or with a color that benefits Yellow’s relative luminance (a darker color such as a Deep Blue)
Example of pairing against a neutral color (Yellow becomes Mustard if paired with White) or with a color that benefits Yellow’s relative luminance (a darker color such as a Deep Blue)

Designers don’t have the means to solve this with just a click of a button. Accessibility tools didn’t evolve much to offer a viable answer.

But what if…?

Example of an Accessible Design System showing neutrals for Green, with a complementary color palette, and colorblind safe accessible pairings
An Accessible Design System, based on complementary color harmony, per design and from scratch.

An algorithm has designed the Accessible and Color Safe Design System above. It calculated over 45,000 permutations in less than a second. It is more than a Developer would handle by hand or computational thinking.

Perhaps, the puzzle to challenge is why we still request Designers to address this problem.

--

--