Color contrast for accessibility: ratios, bad examples and fixes
The WCAG contrast ratios in plain terms, six bad color contrast examples with the exact colors that fix them, and a high contrast palette you can copy.
Anne JollerCustomer Success Manager · 9 min read

Color contrast is the difference in lightness between text and the background behind it. For accessibility, WCAG measures it as a ratio from 1:1 (the same color) to 21:1 (black on white). Body text needs at least 4.5:1 to meet level AA. Large text, icons and the edges of buttons and fields need 3:1.
Low contrast is one of the most common problems automated scans find, and one of the easiest to fix. You usually change a hex value or two in your theme, and every page gets better at once. This guide covers the rules, six examples of bad color contrast with the exact colors that fix them, and a high contrast palette you can start from.
Why contrast matters, and for whom
Faint text is harder for everyone. It’s hardest for people with low vision, for many older readers, and for anyone with color blindness when the two colors differ only in hue. It also gets worse in ordinary situations: a phone in sunlight, a cheap laptop screen, a dimmed display at night.
Contrast is about lightness, not hue. Red on green looks bold, but the two colors are almost equally light, so the text barely stands out once you take hue away. That’s also why WCAG 1.4.1 says color should never be the only way you show something, such as an error or a sale price.
The contrast ratios WCAG asks for
Three success criteria cover it.
- 1.4.3 Contrast (Minimum), level AA. Text needs 4.5:1 against its background. Large text needs 3:1. Large means at least 24px regular, or about 18.7px bold.
- 1.4.11 Non-text Contrast, level AA. The visible parts of controls (a field’s border, a checkbox, a focus outline) and icons that carry meaning need 3:1 against what sits next to them.
- 1.4.6 Contrast (Enhanced), level AAA. 7:1 for text and 4.5:1 for large text. Nice to reach for body copy, not something most sites commit to.
Logos and brand names are exempt, and so is text on a disabled control and text that’s pure decoration. Placeholder text inside a field is not exempt. If it carries information, it needs 4.5:1 like any other text.
- 4.5:1Minimum for body text and links at level AA.WCAG 2.2, 1.4.3
- 3:1Minimum for large text, icons, field borders and focus outlines.WCAG 2.2, 1.4.3 and 1.4.11
- #767676The lightest gray that still passes as body text on white (4.54:1).Computed with the WCAG formula
That last number is worth remembering. Any gray lighter than #767676 on a white background fails as body text. A lot of themes ship with #999 or #aaa for “secondary” text, and both fail.
Bad color contrast examples, and the fix for each
These six pairs come up again and again in store and SaaS themes. Each one shows the failing colors, a fix that keeps the look, and the real ratio for both.
A few patterns sit behind most of them.
Gray used as decoration. Designers reach for light gray to make secondary text feel quiet. Quiet is fine. Pick a gray between #595959 and #767676 and use size or weight to show what matters less.
Brand colors that were never tested with text. A pastel brand color can work as a background for dark text and fail completely behind white text. Test both directions before you pick one. The palette below shows which text color each background takes.
Dark mode as an afterthought. A link color that passes on white often fails on a dark footer or a dark theme. Every background you use needs its own check.
Text on photos. A scanner can’t measure contrast on text that sits on an image, because the background changes pixel by pixel. Put a solid or semi-opaque panel behind the text, or move the text off the image. I covered more of what software can’t fix in widgets, overlays and real fixes.
When a client pushes back on darker text because it “looks heavy”, I show them the page on a phone outside. That ends the discussion faster than any ratio does.
What this looks like on a real product page
Numbers on swatches are one thing. Here is the same thing on a product page. Our demo store runs Shopify’s Horizon theme, and its default colors passed: an axe contrast scan of the home page, the catalog and a product page found no failures.
So we did what a lot of store owners do. We lightened the price, the description and the “More payment options” link to soft grays, and made the Add to cart button a pastel green. Then we scanned again.
Soft grays

Fixed colors

The scan with soft grays found 8 contrast failures on that one page:
- The price, #b5b5b5 on the cream background, at 1.93:1. The same gray repeated on four prices in the “You may also like” row.
- Both description paragraphs, #a3a3a3, at 2.37:1.
- The “More payment options” link, #9ca3af, at 2.39:1.
The scan didn’t flag the button at all, even though white on that mint green is 2.25:1. Scanners can miss a background they can’t resolve, which is why the spot check in the next section matters.
The fix was four color values: #374151 for prices (9.72:1), #4b5563 for the description (7.12:1), the theme’s darker link color, and a deep green button behind the white text. A rescan found 0 failures. The page still looks soft and calm. It’s just readable now.
A high contrast color palette you can start from
You don’t have to give up color to pass. Dark, saturated colors work as backgrounds for white text, and light ones work behind black text. The trouble is the middle, where neither black nor white reaches 4.5:1.
Black text 1.43:1
Black text 2.09:1
Black text 2.63:1
Black text 3.21:1
Black text 2.4:1
Black text 12.57:1
Black text 15.82:1
Black text 19.81:1
Use it like this:
- Text colors: Ink, Navy, Forest, Brick and Plum all pass on white and on the cream Paper background, so any of them can carry body text or links.
- Button backgrounds: the same five take white text. Brick is the lowest at 6.53:1, which still clears AA with room to spare.
- Highlights and badges: Amber and Sky take black text, never white. White on Amber is 1.66:1.
If your brand color sits in the middle, keep it for large shapes and borders, where 3:1 is enough, and use a darker shade of it for text and buttons. Most design tools can generate a darker step of the same hue.
How to check contrast on your own site
- Run a scan first. Our free accessibility checker runs 60+ WCAG checks on a page in under a minute, and low contrast is one of them. It lists each failing element, so you know which colors to change.
- Spot-check what looks pale. In Chrome DevTools, inspect the text and click the color swatch next to its
colorvalue. The picker shows the ratio and a line where AA and AAA pass. My guide to checking your website’s accessibility walks through it. - Check every state. Hover, focus, visited links, error messages, sale badges, disabled buttons that aren’t really disabled. Scanners only see the state the page loads in.
- Check text on images by eye. Software can’t do this one for you.
- Fix it in the theme, not page by page. Change the color variable once and every page picks it up. Then scan again.
Contrast is one item on a longer list. Our WCAG 2.2 checklist has the rest of level AA.
Where Accessora fits
The Accessora checker finds contrast failures on any public page for free. With a paid plan, the dashboard audits scan your pages on a schedule and list every issue by WCAG criterion, so a color that drifts back into a theme update shows up again.
For visitors, the Accessora widget has a Colors section: High Contrast, Brightness, Invert Colors, Saturation, and color filters for grayscale and common types of color blindness. A visitor turns on what helps them, and the setting follows them from page to page.

Those controls change how the page looks for one visitor. They don’t change your colors, so a scan still reports the same failures until you fix the theme. Do both: fix the colors, then let visitors adjust from there.
To try it, start a free trial. Every plan has a 7-day free trial. Shopify stores can add it from the Shopify App Store, where there is a Free plan.
Quick answers
What is a good contrast ratio for text?
At least 4.5:1 for body text and 3:1 for large text, to meet WCAG level AA. If you can reach 7:1 for body text, that meets AAA and reads well in harsh light.
Does color contrast apply to buttons and icons?
Yes. The text on a button needs 4.5:1 against the button color. The button’s shape, a field’s border and meaningful icons need 3:1 against the background next to them, under WCAG 1.4.11.
Is gray text on a white background accessible?
It can be. #767676 is the lightest gray that passes as body text on white. Anything lighter, such as the common #999999 (2.84:1), fails.
Color contrast, in short
- Body text and links at 4.5:1 or more against their background
- Large text, icons, field borders and focus outlines at 3:1 or more
- No gray lighter than #767676 for text on white
- Placeholder text passes too, or a real label sits above the field
- Hover, focus, error and sale states checked, not just the default
- Text on images has a solid panel behind it
- Color never the only signal for errors, prices or status
- Fixed in theme variables, then scanned again

Anne helps Accessora customers make their sites easier for everyone to use, and writes about where tech and AI help accessibility and where they still fall short.


