Real ratios for common pairs
A scanner turns the camera image into light and dark and ignores hue. Two colors that look nothing alike can be nearly the same brightness, and then the code is unreadable. The number that captures this is the contrast ratio, from 1:1 (identical) to 21:1 (black on white).
We ran these pairs through the same contrast function our generator uses:
| Code color | Background | Ratio |
|---|---|---|
Black #000000 | White | 21.0 |
Our default #0a0a0a | White | 19.8 |
Navy #1f2a44 | Cream #fdf6e3 | 13.2 |
Burgundy #800020 | White | 10.8 |
Forest green #1b5e20 | White | 7.9 |
Our Cobalt preset #1d3fd6 | White | 7.7 |
Red #e53935 | White | 4.2 |
Red #ff0000 | Green #00ff00 | 2.9 |
Mid grey #9e9e9e | White | 2.7 |
Orange #ff9800 | White | 2.2 |
Light blue #7fb3ff | White | 2.1 |
Yellow #ffd400 | White | 1.4 |
Our generator warns below 3:1 and the contrast checker recommends at least 4.5:1. By those lines, bright red on white is borderline, and orange, light blue and yellow are out. Pure red on pure green fails too, though no two colors look more different to most people.
Where the 4.5:1 comes from
The ratio is the formula from the web accessibility guidelines (WCAG), and the 3:1 and 4.5:1 thresholds are borrowed from there. The QR standard doesn't use them. Print-quality grading for barcodes measures how much light the printed dark and light areas reflect, with a verifier, which a screen can't tell you.
So treat the ratio as a screen-side check that catches bad pairs early. Paper, ink, laminate and lighting all eat into contrast, which is why we set the recommendation above the warning.
Light codes on dark backgrounds
QR codes were designed as dark on light. Plenty of phone cameras read the reverse, but some scanner apps don't, and you can't choose what people scan with. Our generator shows a warning whenever the code is lighter than its background, and our online scanner tries both ways round when it reads an image.
If the light-on-dark look matters to the design, keep the code dark on a light panel and let the dark color fill the space around it.
Where to spend the brand color
Keep the modules dark and the background light, and put the brand color on a frame, a label or the logo. A logo in the middle is ignored by the scanner, so it can be any color you like; QR codes with a logo covers how big it can be.
Low contrast also raises the size a code needs. The size guide suggests printing larger when the light is poor, and the same applies to soft color pairs. The margin around the code takes the background color, and must stay empty; see quiet zone.