Skip to main content

Let's pretend that you've created a pie chart that you want to put into a presentation. You think you've settled on a color palette that is using brand colors.

"It looks pretty good!" you think. And you're right – it does!

But how does it look from an accessibility standpoint?

A pie chart with five segments representing different categories. The largest segment, in dark blue, representing Value Chain Innovation with 58%. The second largest segment, in medium blue, represents Artificial Intelligence with 32%. The third segment, in light blue, represents Structured Test with 8%. The fourth segment, in gray, represents Generative AI with 16%. The smallest segment, in light gray, represents Partnerships with 3%.

Let's start by looking at the contrast between each of the colors.

According to WCAG, we need at least a 3:1 contrast ratio from one color to the next. For good measure, we should probably make sure that colors similar to each other aren't used - so they can be differentiated from each other.

We'll start from 12 o'clock.

From Pale Gray to Dark Gray we're good at 3.44:1. Between the Light Blue and the Dark Blue we're at 8.93:1. That's good, too. And from Vibrant Blue to Light Gray, we're at 3.28:1. Great!

A pie chart with five segments in different shades of blue and gray. The legend on the right shows the contrast ratios for each color pair, with three pairs marked as passing (green check mark) and two pairs marked as failing (red X).

Now, from Dark Gray to Light Blue we're at 2.72:1 - and from Dark Blue to Vibrant Blue, we're at 2.02:1.

Well, darn, there are two sets of colors that don't meet the 3:1 contrast threshold.

But, they're close aren't they? Doesn't that count?

No, unfortunately. Unlike horseshoes, there is no credit for 'pretty close'. It either passes the threshold or it doesn't.

Maybe we should re-think the colors...


A turquoise background with intricate geometric patterns and the text '1 HOUR LATER' in bold, white letters with a black outline in the center.

After playing around for a little while, you come up with a new palette that meets the required thresholds by moving a couple of colors around and choosing two new colors. Now from Medium Blue to Light Gray we're at 3.14:1. From Light Gray to Dark Mint we're at 4.05:1. Dark Mint to Light Blue is 3.17:1. Light Blue to Dark Blue is 8.69:1 and Dark Blue to Medium Blue is 3.53:1. Great!

So we're done, right?

No, we're kinda just getting started. Now it's time to look at the pie chart through other people's eyes.

A pie chart labeled 'Trial A - Contrast' with five segments in different colors. The legend shows the colors and their corresponding ratios: blue (3.14:1), gray (4.05:1), green (3.17:1), light blue (8.69:1), and dark blue (3.53:1). All ratios have a checkmark next to them.

Often times when people think of color blindness, they think that people see in either all color or only shades of gray. The degree of the specific color deficiency and the presence of multiple forms of color blindness all affect how a person perceives color. The 4 major groups of color blindness are:


See this article about the types of color blindness to learn more specifics.


Let's take a look at what those individuals would see if looking at our pie chart.

Here's how someone with Protanopia or Protanomaly would see the chart.

'Trial A' pie chart with colors displaying as they would through the eyes of an individual with Protanopia
'Trial A' pie chart with colors displaying as they would through the eyes of an individual with Protanomaly

OK. That looks almost exactly the same... Why are we doing this?

'Trial A' pie chart with colors displaying as they would through the eyes of an individual with Deuteranopia
'Trial A' pie chart with colors displaying as they would through the eyes of an individual with Deuteranomaly

Oh! Now I can see the differences starting to show up. In the Deuteranopia example the light blue looks purple now... The light gray looks... pink? And green is now gray? Weird!

Well, at least they can still be obviously differentiated. Lookin' good so far!

Now for Achromatopsia / Achromanomaly...

'Trial A' pie chart with colors displaying as they would through the eyes of an individual with Achromatopsia
'Trial A' pie chart with colors displaying as they would through the eyes of an individual with Achromatomaly

Other than the obviousness that the Achromatopsia example is all shades of gray, I'm starting to understand why this might be helpful.

Again, the colors (and shades of gray) can still be differentiated. Yes!

Here comes the last one... Tritanopia / Tritanomaly.

'Trial A' pie chart with colors displaying as they would through the eyes of an individual with Tritanopia
'Trial A' pie chart with colors displaying as they would through the eyes of an individual with Tritanomaly

Uh-oh. (sigh)

Tritanomaly looks good, but in the Tritanopia example that big section at the bottom and the portion at the 1 o'clock position look almost the same.

Back to the drawing board...


Image showing a background with a yellow and green pattern featuring pineapples. In the center, there is blue text that reads 'ONE HOUR LATER...'

Do I really have to try a whole new set of colors?

Maybe. Maybe we can just change out one or two and it'll work?

(Gosh, I hope so... this is starting to be a pain in the neck.)

A pie chart titled 'Trial B - Contrast' with five segments in different colors. The legend shows the contrast ratios for each color: light gray (3.44:1), yellow (3.02:1), green (12.52:1), dark blue (3.58:1), blue (3.14:1). Each ratio has a checkmark next to it indicating compliance.

OK, first step, do they meet contrast requirements? Answer, yes.

Light Gray to Dark Mint is 3.44:1. Dark Mint to Lemon Yellow is 3.02:1. Lemon Yellow to Dark Blue is 12.52:1. Dark Blue to Medium Blue is 3.58:1 and Medium Blue to Light Gray is 3.14:1.

Step one? Success!

Now let's look at the other vision deficiencies versions.

'Trial B' pie chart with colors displaying as they would through the eyes of an individual with Protanopia
'Trial B' pie chart with colors displaying as they would through the eyes of an individual with Protanomaly
'Trial B' pie chart with colors displaying as they would through the eyes of an individual with Deuteranopia
'Trial B' pie chart with colors displaying as they would through the eyes of an individual with Deuteranomaly
'Trial B' pie chart with colors displaying as they would through the eyes of an individual with Tritanopia
'Trial B' pie chart with colors displaying as they would through the eyes of an individual with Tritanomaly
'Trial B' pie chart with colors displaying as they would through the eyes of an individual with Achromatopsia
'Trial B' pie chart with colors displaying as they would through the eyes of an individual with Achromatomaly

Alright!

Seems like a pretty decent color palette...

They all have some semblance of differentiation from a color perspective.


After the feeling of accomplishment has worn off, you realize that there is still a small (but nagging) concern... Dark Mint and the Medium Blue colors – those kinda look similar in both the Achromatopsia and Tritanopia versions.

You really wanted to be done with this. Do we have do this all again?!

That is definitely one way to handle it, but, in this case, we should be able to solve this pretty easily.

Really?!

Yep.

We can add a pattern to one color or the other.

Let's try a vertical line pattern over one of those background colors - we'll pick the one closest to the top... the Dark Mint one.

How does that look?

'Trial B' pie chart with one piece of the pie displaying a vertical, single pixel repeating stroke pattern.
'Trial B' pie chart with one piece of the pie displaying a vertical, single pixel repeating stroke pattern and colors displaying as they would through the eyes of an individual with Achromatopsia.

Now I can definitely tell the difference between those two backgrounds!

Perfect! You've made an accessible pie chart!

WE'RE DONE!!! (Aren't we?)

Almost.

Unfortunately, there are still two more items to consider: 1) the legend, and 2) the entire chart (and it's internal colors) to the background that the entire pie chart is sitting on.

Again, both of those must meet the same ≥3:1 contrast ratio threshold. And that Light Gray versus the background probably doesn't pass that threshold (again).

The legend text is even more restrictive - it has to meet a ≥4.5:1 ratio against the background.

First, let's deal with the Light gray to the background.

We know this is going to be presented on a white background. I need to look at the contrast of all the colors of the pie to white. After using a contrast checker (e.g. WebAIM), you discover that the Light gray slice of pie has a contrast ratio of only 1.43:1 with the white background.

But you ALSO discover that the Lemon Yellow has the same issue, only it's contrast ratio is 1.29:1.

Image showing a pie chart with five different colored segments and a legend indicating the color contrast ratios of each segment to the background. The colors are light gray, green with stripes, yellow, blue, and dark blue. The contrast ratios are 1.43:1 (light gray), 5.84:1 (green with stripes), 1.29:1 (yellow), 15.99:1 (blue), and 4.52:1 (dark blue). There are check marks next to the green with stripes, blue, and dark blue ratios indicating they meet contrast requirements, while there are red X marks next to the light gray and yellow ratios indicating they do not meet contrast requirements.

What?!

What are we going to do?! There is no way that this should be this hard. Wouldn't it be just as easy to not have a pie chart?

I promise, we are almost there...

There are multiple ways to fix this, but by far the easiest is this: Let's give the entire pie chart a 1px solid charcoal border.

It can't be that simple. Nothing has been that simple so far.

In this case, it is. That 1px charcoal border acts as a separator to the slices of pie that need don't meet the 3:1 contrast ratio.

What about the other pieces of the pie? Don't they now get all messed up?

A pie chart titled 'Trial B - Pattern + Outline' with five segments in different colors and patterns. The legend on the right shows the colors/patterns with corresponding ratios and check marks indicating success. The segments are as follows: light gray (3.44:1), green stripes (3.02:1), yellow (12.52:1), blue stripes (3.58:1), dark blue (3.14:1). This version also displays a 1px black border around the pie chart.

No - and that's the beauty of this method. The colors that do pass on the white still pass against white. The charcoal border gives the appropriate contrast to the pieces that don't pass and doesn't effect the accessibility of the ones that already pass.

Booyah!

Alright, one final step. Our legend color markers are colored circles on a white background.

Based on what we just did with the pie chart and background colors, we now know which colors do and don't pass the contrast threshold on white - and they follow the same ≥3:1 contrast ratio rule.

And, wait... (realization) our pie chart is a circle... and each one of those legend color keys is a circle as well.

Will that same strategy we just used for the pie chart work with these?

You bet your bippy it will! Same principal... same solution.

A pie chart titled 'Trial B - Pattern + Outline' with five segments in different colors and patterns. The legend on the right shows the colors/patterns with corresponding ratios and check marks indicating success. The segments are as follows: light gray (3.44:1), green stripes (3.02:1), yellow (12.52:1), blue stripes (3.58:1), dark blue (3.14:1). This version displays the 1px black border around both the pie chart and each legend key colored circle.

The last step is adding back in the numbers...

A pie chart titled 'Final' with five segments representing different categories. The largest segment, 58%, is dark blue labeled 'Structured test.' The second largest segment, 32%, is light blue labeled 'Value chain innovation.' The third segment, 16%, is green labeled 'Generative AI.' The fourth segment, 8%, is yellow labeled 'Partnerships.' The smallest segment, 3%, is gray labeled 'Artificial intelligence.'

Now are we done?

Yes we are!

But... here's the key: when implementing, you need to ALWAYS apply them in this order, and this ONLY works with these 5 colors. If you only have 4 colors, you'll need to look at this process again with only the 4 colors. Same with 6, and 7, etc. You'd have to do the same process with all the chosen colors (albeit you would have a good staring point)!

Making an accessible pie chart – who knew it'd be that involved?!

We did! And we wanted to share it with you, so you'd know how to do it too!

Display settings

Note: not all settings persist across pages

Default Compact (-1) Sparse (+1) XL (default) 2XL 3XL Default Min Max Light (default) System Dark Branded (default) Unbranded