Guides / Design

Colored QR codes that still scan

A QR code can be almost any color. What breaks it is not the hue but a lack of lightness difference between the dots and what's behind them.

2 min readDesign
On this page How a scanner sees color Rules that keep colored codes working Using your brand colors Questions
In short
  • Lightness matters, not hue.
  • Contrast 4.5:1 minimum, 7:1 for print.
  • Check the lightest color in a gradient.

How a scanner sees color

Before decoding, the camera turns the image into black and white using a brightness threshold. Your bright orange becomes either "dark" or "light" based on how bright it is. So the only question is: are the dots clearly darker than the background?

Contrast ratio measures exactly that, from 1:1 (no difference) to 21:1 (black on white).

The same code in six colors. Red and green look strong but are lighter than they seem. Labels describe printed, real-world scanning; a clean screen is much more forgiving.

Rules that keep colored codes working

  1. Dark dots, light background. Use a contrast ratio of 4.5:1 at minimum, and 7:1 for print.
  2. Check the lightest part of a gradient. A gradient is only as good as its weakest color.
  3. Color the corner squares freely, but keep them dark. The three big corner squares are how scanners find the code, so they need the same contrast as the dots.
  4. Be careful with inverted codes. Light dots on a dark background work in most modern phone cameras, but not in every scanner app or retail scanner. See inverted QR codes.
  5. Avoid busy backgrounds. Photos or patterns behind the code confuse the threshold. Put the code on a solid panel.
Inverted codes look striking, but not every scanner can read them. Labels describe printed, real-world scanning; a clean screen is much more forgiving.

Try a warm gradient that passes the contrast check, then make it your own.

Use sunset preset

Using your brand colors

If your brand color is light, such as yellow, mint or sky blue, don't use it for the dots. Use it for the frame, the corner centers or the background panel around a dark code instead. If your brand color is mid-tone, darken it by 20–30% for the dots; most people won't notice the shift.

The QRaft generator rates contrast for every color you pick, including the corners and both gradient colors, and runs a real decode test so you know before you download.

Questions

Can a QR code be any color?

Almost. The dots must be clearly darker than the background. Aim for a contrast ratio of 4.5:1 or more; hue does not matter, lightness does.

Do gradient QR codes work?

Yes, as long as the lightest color in the gradient still has strong contrast with the background.