Palette Contrast Matrix
Check every palette color pairing against WCAG text contrast thresholds.
Try an example: A three-color interface palette · Black and white
How it works
Paste up to 24 opaque colors in HEX, GPL or JASC-PAL format. Compare every foreground and background pair, with exact ratios and AA, AAA and large-text results, then download a CSV report.
- Decode opaque sRGB channels to linear light using the 0.04045 breakpoint and calculate luminance with coefficients 0.2126, 0.7152 and 0.0722.
- Contrast is (lighter luminance + 0.05)/(darker luminance + 0.05). Normal text AA needs 4.5:1 and AAA 7:1. Large text AA needs 3:1 and AAA 4.5:1. Threshold decisions use unrounded ratios.
- Rows are foregrounds; columns are backgrounds. Identical-color pairs have ratio 1. Large text means at least 18 pt regular or 14 pt bold. Color-pair results do not certify a complete interface or text over photographs.
Sources
- CSS Color: HSL and sRGB (W3C)
- WCAG 2.2: Contrast minimum (W3C)
- Super Color Palette: workflow inspiration (Super Color Palette)
Related tools
- Photo Palette & Text Contrast – Check palette luminance and choose readable text for photos and graphics.
- Color Harmony & Shift Generator – Build HSL harmonies with eased shifts, locked colors and reusable palette exports.
- Pixel Palette Format Converter – Convert HEX, GIMP GPL and JASC-PAL palettes without changing color order.
How to use the Palette Contrast Matrix
Paste up to 24 HEX, GPL or JASC-PAL colors and see every text-on-background pairing with exact WCAG contrast ratios and AA/AAA results.
What it is for
A palette looks good as a row of swatches, but the real question comes later: which of these colors can carry text on which background? This tool takes up to 24 opaque colors and checks every ordered pair, with each color as text on every other color and on itself. You get the contrast ratio and the WCAG 2.2 decision for normal and large text.
Paste a plain HEX list, or the text of a GIMP GPL or JASC-PAL palette file. The tool only judges flat color pairs. It cannot see your font, the text's opacity or a photograph behind the words, so a passing pair is a good sign, not a certificate for a whole page.
Worked example
A four-color poster palette exported from a pixel editor as JASC-PAL with 224 122 95, 61 64 91, 129 178 154 and 244 241 222 (that is #E07A5F, #3D405B, #81B29A, #F4F1DE). The summary reads "4 colors with 16 foreground/background checks."
The interesting rows:
| Text | Background | Ratio | AA | AAA | Large AA |
|---|---|---|---|---|---|
| #3D405B | #F4F1DE | 8.87 | Pass | Pass | Pass |
| #3D405B | #81B29A | 4.21 | Fail | Fail | Pass |
| #E07A5F | #3D405B | 3.42 | Fail | Fail | Pass |
| #F4F1DE | #E07A5F | 2.6 | Fail | Fail | Fail |
| #E07A5F | #81B29A | 1.23 | Fail | Fail | Fail |
So the navy on cream works for everything, including body text at AAA. Navy on sage and coral on navy are fine for headlines only. Cream on coral fails even for large text, although it is a popular combination.
Thresholds really are exact: #777777 on white scores 4.48 and fails AA, while #767676 scores 4.54 and passes.
How to read the result
- Text is the foreground and Background the color behind it. Every pair appears in both directions; the ratio is the same either way, but you can scan by the role you need.
- Ratio runs from 1 (identical colors) to 21 (black on white). The table shows two decimals; the decisions use the unrounded value.
- AA needs 4.5:1 and AAA 7:1 for normal text. Large AA needs 3:1 and Large AAA 4.5:1. Large means at least 18 pt regular or 14 pt bold.
- Download contrast CSV contains every pair with the full-precision ratio and
true/falsecolumns for sorting in a spreadsheet.
Tips and common mistakes
- The diagonal (a color on itself) always shows 1 and fails. It is there so the matrix is complete; skip it.
- Use six-digit HEX values with
#. Short forms like#fff, color names and transparent colors are rejected, and a list can hold 1–24 colors. - A GPL file must start with
GIMP Palette; a JASC file needsJASC-PAL,0100and a color count that matches its rows. - Mid-tones are the trap. Colors around
#777777fall just short of 4.5:1 against both black and white. - If nothing passes for body text, add a very dark and a very light neutral to the palette and run it again.
FAQ
Why does the table show the same ratio twice?
Contrast is symmetric. The matrix lists both directions so you can read it as "this text on that background" without swapping colors in your head.
Does a pass mean my page is accessible?
No. It means that color pair meets the contrast threshold for flat, opaque text. Font weight, size, transparency, images behind text and every other accessibility requirement still need checking.
Can I check a palette from Flipline or GIMP?
Yes. Paste the text of a .gpl or .pal file. Lumina's Palette Studio and Flipline export these formats.
Why is 4.48 a fail when it rounds to 4.5?
WCAG thresholds have no rounding. The tool compares the exact ratio with 4.5, so 4.48 fails.
Guide last updated:
For scripts and AI agents
- JSON API:
POST https://luminapalettecontrast.usefulweb.site/api/v1/calculate(same calculation as this page) - Interface description: OpenAPI 3.1 · AI guide: llms.txt
- MCP server (Streamable HTTP):
https://luminapalettecontrast.usefulweb.site/mcp· tool namelumina_palette_contrast
Example request
curl -s -X POST https://luminapalettecontrast.usefulweb.site/api/v1/calculate \
-H 'content-type: application/json' \
-d '{"colors":"#164E63 #72A5A0 #ECF0DE"}'