Sub topic 9
Contrast and Legibility
This chapter assumes you know typefaces, sizes and weights, and have read the earlier chapters on hierarchy, negative space and color relationships. Here you learn how to judge whether text can actually be read against its background, and what to adjust when it can't.
Contrast is more than light versus dark
Contrast is the difference between text and the surface behind it. Three kinds matter in a layout:
- Value contrast: how light or dark each color is. This does most of the work.
- Size and weight contrast: thin, small type needs more value contrast than large, bold type.
- Hue contrast: red against green can look vivid yet have nearly the same lightness. Hue alone rarely keeps text readable.
A quick test is to desaturate your layout, or squint at it. If the text disappears in grayscale, value contrast is too low.
Measuring contrast
The Web Content Accessibility Guidelines (WCAG) define a contrast ratio from 1:1 (no difference) to 21:1 (black on white). Common targets:
| Text | Minimum ratio (AA) |
|---|---|
| Body text (under about 24 px regular) | 4.5:1 |
| Large text (about 24 px, or 19 px bold) | 3:1 |
Most design tools have a contrast plugin, and browser dev tools show the ratio for a selected element.
Why images are harder than flat color
A photo has bright and dark patches, edges and texture. Text that crosses a highlight can vanish even if the rest of the line is fine. Busy detail, such as foliage or crowds, also breaks up letter shapes.
You have four main fixes, in order of preference:
- Move the text into a calm area, using the negative space you found earlier.
- Change the type: increase size or weight, or switch from a thin face to a sturdier one.
- Change the color: use white on dark areas or near-black on light ones.
- Change the image: add a scrim, blur or darken the region. The next chapters cover these in detail.
Legibility details that affect contrast
- Line length and leading: over a textured image, give lines extra leading so they separate from the background.
- Weight: a light 300-weight face looks fine on white and fails on a photo. Use regular or medium.
- Pure white and pure black: these maximize contrast but can glare. Slightly off-white on dark images often reads more comfortably.
- Small text: captions and credits are the first things to fail. Keep them out of busy areas.
Common errors
- Judging contrast on a bright monitor only. Check on a dimmer screen too.
- Trusting the color picker on one pixel of a photo.
- Using a thin face at a small size over an image.
- Adding a heavy drop shadow to rescue text. It often looks dated and still leaves low contrast.
Exercise
White 18 px regular body text sits over a photo. The darkest area behind it gives a 5:1 ratio, but a bright cloud behind the second line gives 2:1. Does the text pass, and what is the best first fix?
Show answer
It fails, because text must pass against the worst area behind it, and 2:1 is below the 4.5:1 target. The best first fix is to move the text to a calmer area of the image. If that isn't possible, add a scrim or darken the region behind the text.