Color and Contrast
Overview
Color and contrast covers two related ideas: giving colors consistent functional roles (background, surface, text, accent), and making sure the contrast between them is strong enough to read comfortably.
Why It Matters
Color that is chosen only for mood, without functional roles, ends up inconsistent: the same shade might be a background in one place and an accent in another, which confuses rather than reinforces the page's hierarchy. Low contrast text, meanwhile, is unreadable for a meaningful share of users well before it becomes a legal or ethical accessibility issue.
Core Principles
- Give every color a functional role. Backgrounds use lighter or muted tones for readability, text and primary elements use darker tones for contrast (inverted on a dark theme like Template Interface's own), and accents use brighter, saturated tones specifically to draw attention to calls to action.
- Contrast reinforces hierarchy, not decoration. The highest-contrast element on a page should usually be the one you most want noticed first.
- WCAG AA sets a measurable floor. 4.5:1 contrast for body text, 3:1 for large or bold text, are not stylistic opinions, they are the minimum for comfortable legibility for most users.
Interactive Demo
Contrast ratio: 15.8:1 · Passes WCAG AA
Common Mistakes
- Choosing colors for mood or brand alone, without checking the resulting contrast ratio against the text placed on top of them.
- Using the accent color as body text color because it "matches the brand," even when its contrast against the background is too low to read comfortably.
- Testing contrast only against pure black or pure white instead of the actual background and text tones used in the design.
Related Concepts
- Visual Hierarchy: color is one more tool for establishing hierarchy, alongside size and weight.
- Typography: legible type still depends on sufficient contrast against its background.
- Accessibility and WCAG Basics: contrast ratio is one of several WCAG AA success criteria.
- Template Interface Color Standard: this site's rules, graded palette and color roles, ready to use, with the contrast of every pairing checked.
Used In Templates
Demonstrated directly in the Landing Page, Blog and Article Site, E-commerce Product Page, SaaS Pricing Page, and Nonprofit and Charity Site templates; see docs/PRD.md section 13.2.
Summary
Color works best when every value has a clear job: background, text, or accent, and when the contrast between them is checked, not assumed. WCAG AA's 4.5:1 and 3:1 thresholds are a measurable way to confirm that assumption instead of guessing.