Qraft

Why QR Codes Still Scan in Color and Where They Stop Working

QR Codes Do Not Have to Be Black and White

Most people picture QR codes in black and white, but they can actually be scanned in other colors too. Red and white, navy and white, green and white. Many of you have probably seen QR codes designed to match a company's brand color.

A QR code scanner does not recognize colors as such. What it recognizes is the contrast (difference in brightness) between "light areas" and "dark areas." Black-and-white QR codes are the easiest to read because the contrast between white and black is at its maximum.

In other words, a QR code works in any color as long as it combines a "dark color" with a "light color." Dark red and white, dark blue and white, dark green and white. All of these have enough contrast, so they scan without any problem.

Color Schemes You Should Never Use

On the other hand, some color schemes make QR codes unreadable. The most dangerous is "color inversion."

Light modules on a dark background: The QR code specification defines the modules (the squares that represent data) as the "dark color" and the background as the "light color." If you reverse this (white modules on a black background), many scanners cannot read the code correctly. Some scanners do support inverted codes, but not every scanner can read them.

Low-contrast combinations: Yellow and white, light blue and white, pink and orange. Combinations of two light colors have low contrast, so the scanner cannot tell where the module boundaries are. Likewise, combinations of two dark colors, such as dark blue and black or dark green and dark brown, are also hard to read.

Red and green combinations: For people with color vision differences (color weakness), red and green are the hardest pair of colors to tell apart. Even if a scanner can read the code, the human eye has a harder time noticing that "there is a QR code here." It is a color scheme to avoid from the standpoint of accessibility.

Guidelines for Contrast Ratio

In practice, the guideline for a contrast ratio that lets a QR code be read reliably is said to be 4:1 or higher between the modules and the background. Because a camera's decoder determines module boundaries by applying a threshold to differences in brightness rather than hue, a brightness difference at this level lets almost all scanners read the code consistently. Note that the 4.5:1 ratio in WCAG (Web Content Accessibility Guidelines), used for text readability on the web, is a separate standard for people reading text, and it is not a figure that guarantees whether a code can be scanned.

You can easily check the contrast ratio with free online tools (such as WebAIM Contrast Checker). Just enter the color code of the modules and the color code of the background, and the contrast ratio is calculated. However, passing on the numbers is only a guideline, so be sure to include a step where you actually scan the code once on the real printed material or screen you will use. It is not unusual for a code that looks fine on screen to lose density when printed, shrinking the brightness difference.

When in doubt, the safest choice is to return to the basics: "modules in black or a dark color, background in white or a light color." Pursuing design so far that the code can no longer be scanned defeats the whole purpose.

Can You Use a Gradient or Photo as the Background?

Using a gradient or a photo as the background of a QR code is technically possible, but it is risky. Because the background color changes from place to place, some modules may lack sufficient contrast, which can cause scanning errors.

If you really want to use a gradient background, the safe approach is to leave plenty of white margin (the quiet zone) around the QR code and to place the QR code itself on a solid-color background. Decorate the "outside" of the QR code with your design, and keep the "inside" of the QR code simple. Using the two this way is the key to balancing design and scannability.

When you place a QR code over a photo, an effective technique is to lay a semi-transparent white square behind the QR code. This keeps the mood of the photo while securing the contrast needed to scan the QR code.

Fun Ways to Play With QR Code Colors

As long as you follow the rules, playing with QR code colors can be fun.

Unify with brand colors: Filling the modules with a company's logo color gives business cards and flyers a consistent look. Coca-Cola red, Starbucks green, Facebook blue. A brand's QR code shows "which company it belongs to" at a glance on its own.

Create a seasonal feel: Red and green for Christmas cards, orange and black for Halloween, pink and white for cherry blossom season. QR codes in seasonal color schemes delight the eyes of the people who receive them (but be careful about contrast with red and green combinations).

Change the shape of the modules: Design QR codes that turn the square modules into circles or hearts are also popular. Thanks to the error correction feature of QR codes, a certain amount of distortion is tolerated. However, too much distortion makes the code unreadable, so be sure to test it before using it.