30

Color in Typography and Text: Readable, Accessible, Beautiful

Most color advice is about pictures; this is about words. Text color has a stricter job than any swatch on a wall - it has to be read, comfortably, for minutes at a time, by everyone. That makes typography the most demanding place color works: too little contrast and it strains; colored body text often backfires; links must be findable without color; and code needs a palette that holds together. This is the interactive guide to coloring text.

Design · 63 4 Live Demos ~30 min read Type & reading
contrast
Readable text needs it
not #000
Soften pure black
links
Color + a second cue
code
Legible token colors
01

The hardest job for color

A logo is glanced at; a paragraph is read, line after line, by a tired eye on a bright screen at midnight. Text color therefore answers to a tougher master than decoration: legibility first, comfort second, beauty third - and accessibility woven through all of them. The same vivid color that sings as a hero background fails instantly as body text.

Three rules carry most of the weight. Contrast between text and background must be high enough (the WCAG article gives the math). Color should rarely be the only carrier of meaning in text - links and states need a second cue. And the most colorful decisions - headings, links, code - must still hold together as a system. Everything below is a working-out of those three.

Reserve color, don't spend it everywhere. The most readable typography keeps body text at a high-contrast near-neutral and uses color sparingly - a heading accent, a link, a highlighted term. Color in text is punctuation, not paint.
02

The readability lab

Start with the foundation: text and background. Maximum contrast is pure black on pure white, but many designers soften it - a near-black on an off-white - to cut harsh glare without dropping below the line. Tune both colors and watch the contrast ratio and a comfort verdict update.

Interactive 01 · Readability

Text on background, measured

Pick a text and background color; the live paragraph shows the result, and the verdict gives the WCAG contrast ratio plus a comfort note. Aim well above the 4.5:1 body-text minimum - but notice that literal pure-black on pure-white can feel harsh, so a very dark gray on a soft white is a common, comfortable choice.

The quick brown fox

Good typography is invisible: you notice the idea, not the ink. Color sets the comfort of a long read - high enough in contrast to stay crisp, soft enough not to glare. Read this sentence twice and trust your eyes.
03

The risk of colored text

Colored body text is a trap. To meet contrast on a light background, a color must be pushed dark and somewhat desaturated - by which point it is barely "colored" anyway. A bright or pale colored text fails contrast and tires the eye within a paragraph. Compare neutral body text with a colored version and watch the contrast struggle.

Interactive 02 · Colored body text

Why color usually loses to near-black

The same paragraph in a high-contrast neutral and in your chosen color. Push the color's lightness: keep it light and saturated and the contrast fails; force it dark enough to pass and it stops looking colorful. This is why color belongs on headings and links, not long body copy.

Neutral body text reads effortlessly across a whole paragraph, line after line, without asking the eye to work.

Colored body text looks tempting, but to clear the contrast bar it has to go dark and dull - and if it doesn't, it strains.

05

Coloring code

Syntax highlighting is a tiny color system with a hard constraint: every token color must be legible against the editor background, and the set must be distinguishable from each other while staying calm enough to read for hours. Build a theme and watch each token's contrast.

Interactive 04 · Syntax theme

A legible little palette

Set a light or dark editor and choose hues for each token type. The code preview updates live, and each token's contrast against the background is checked - keep them all above the line and distinct from one another for a theme that reads well all day.

06

Text-color practice

Body near-neutral
Keep long-form text a high-contrast near-black (or near-white on dark); save color for accents.
Soften the extremes
#1a1a1a on #fafafa rather than pure black on pure white reduces glare while staying well above 4.5:1.
Underline in-text links
Color plus underline so links are findable without depending on color. Reserve color-only links for clear nav.
Headings can take color
Larger type passes contrast at 3:1, so headings have a little more room for brand color than body.
Check every state
Link, hover, visited, and focus all need contrast and a visible focus ring - not just the default.
Test dark mode separately
Text colors that pass on white can fail on dark. Re-check contrast in every theme.
"A swatch can be admired from across the room; a sentence must survive a thousand glances at arm's length. That is why the strictest color work in any design is hiding in plain sight - in the text." Editorial summary · color you read
07

Pitfalls and gotchas

Low-contrast "elegant" gray
Pale gray text looks refined but fails contrast and excludes readers. Keep body text well above 4.5:1.
Bright colored body text
Saturated text on white rarely passes and strains the eye. Color belongs on accents, not paragraphs.
Color-only links
A colored link with no underline is invisible to many. Add a second cue in body text.
Removing focus outlines
Keyboard users need visible focus on links and fields. Never strip it without a replacement.
Token colors too close
Syntax themes where keyword and string look alike slow reading. Keep token hues distinct and legible.
Forgetting dark mode
Light-on-dark needs its own contrast pass; a link blue that works on white can vanish on near-black.
08

Test your understanding

Six questions on text contrast, colored text, links, and code themes. Instant feedback, no scores recorded - a wrong answer comes with a short explanation.

Quick check

Loading…
 
Question 1 of 6
09

Continue your journey

Text color sits on top of contrast rules, semantic states, the system, and the themes it lives in.