Chapter 16: Building a palette
A palette is the fixed set of colors a product or brand uses, with a role assigned to each. Picking swatches is the easy part. Each color also needs a job, lighter and darker steps, a contrast check against everything it sits on, and a name code can use.
Palette structure
Palette structure is the division of a palette into groups by job. Most interface palettes have four:
- Neutrals: grays, often tinted slightly toward the brand hue, for backgrounds, surfaces, borders and most text. They cover most of the screen.
- Primary: the brand color, used for main actions, links and selected states.
- Accent (or secondary): a second hue for emphasis that shouldn’t compete with the primary.
- Status colors: red for errors, amber for warnings, green for success, blue for information.
Google’s Material Design system builds every scheme from six tonal palettes (primary, secondary, tertiary, neutral, neutral variant and error) and assigns tones from them to named color roles.1 Each fill role has a partner for whatever sits on top of it: primary for a button’s fill, onPrimary for its label. Contrast is then checked once, when the pair is defined.
Brand colors often fail as interface colors. A saturated orange such as #FF6600 gives white text a contrast ratio of 2.94:1, below the 4.5:1 that body text needs; black text on the same orange reaches 7.15:1.2 The usual fix keeps the orange for logos and large shapes and uses a darker step for buttons with white labels.
Tonal scales
A tonal scale is a series of steps of one hue running from near white to near black, spaced evenly in lightness. Tailwind CSS gives each of its 26 default colors 11 steps, numbered 50 to 950, and defines them in OKLCH.3 Radix Colors uses 12 steps and gives each one a job: steps 1–2 for app backgrounds, 3–5 for component backgrounds, 6–8 for borders, 9–10 for solid fills, and 11–12 for text.4
HSL lightness is a poor guide: pure yellow and pure blue are both 50%, yet white text scores 1.07:1 on the yellow and 8.59:1 on the blue.2 Build scales in a perceptual space such as OKLCH (→ 15 Color in screen and print).
Material Design’s HCT color space measures tone from 0 (black) to 100 (white), and Google’s documentation states that a difference of 40 in tone guarantees a WCAG contrast ratio of at least 3:1, and a difference of 50 guarantees at least 4.5:1.5 On such a scale, contrast can be read off the step numbers.
Contrast ratios (WCAG)
A contrast ratio is WCAG’s measure of the difference in brightness between two colors. It is calculated as (L1 + 0.05) / (L2 + 0.05), where L1 is the relative luminance of the lighter color and L2 that of the darker, and it runs from 1:1 for identical colors to 21:1 for black on white.6 Relative luminance weights green most and blue least, following the eye’s sensitivity. Hue and saturation don’t enter into it, so a palette that passes still works in grayscale.
| Content | Level AA | Level AAA |
|---|---|---|
| Body text | 4.5:1 | 7:1 |
| Large text: 18 pt (24 px), or 14 pt (about 18.5 px) bold | 3:1 | 4.5:1 |
| Interface components and meaningful graphics | 3:1 | none set |
The text figures come from WCAG 2.2 success criteria 1.4.3 and 1.4.6; the last row is 1.4.11, which covers the edges of input fields, focus indicators, icons and chart lines.678 The 4.5:1 figure starts from the 3:1 contrast in the ISO 9241-3 and ANSI/HFES 100 display standards, then multiplies it by 1.5 to make up for the contrast sensitivity lost with 20/40 vision, which W3C notes is typical at about age 80.6 Logos, disabled controls and pure decoration are exempt.
The thresholds are strict: 4.499:1 fails.6 On a white background, #767676 is the lightest neutral gray that passes for body text, at 4.54:1; #777777 scores 4.48:1 and fails.2 Conformance levels are explained in → 49 Accessibility and inclusive design.
An alternative formula, the Accessible Perceptual Contrast Algorithm (APCA), appeared in early WCAG 3 drafts but was removed in July 2023, and the April 2026 editor’s draft says the WCAG 3 contrast method is yet to be determined.9 If you use APCA, make sure your colors also meet WCAG 2.
Color vision deficiency
Color vision deficiency (CVD) is a reduced ability to tell certain colors apart. It’s usually inherited and often called color blindness. The red-green types (protan and deutan) are by far the most common; blue-yellow (tritan) types are rare, and complete color blindness rarer still.10 Prevalence varies by population. John Birch’s 2012 review of large surveys found red-green deficiency in about 8% of European men and 0.4% of European women, and in 4–6.5% of Chinese and Japanese men.11 Okabe and Ito put the figure at about one in 25 men of African descent.12
WCAG’s success criterion 1.4.1 (level A) says color must not be the only visual means of conveying information.13 A form that marks errors only with a red border fails it. Add an icon, a label, a pattern or a change of shape.
In 2002, the Japanese researchers Masataka Okabe and Kei Ito published a guide to Color Universal Design with a palette chosen to be unambiguous to people with and without CVD. They also warn that CVD simulators are approximations: ask people with CVD to check the work.12

Wellcome Images, CC BY 4.0, via Wikimedia Commons.
Color tokens
A color token is a named variable that holds a color value, so design files and code say color.text.danger instead of #B3261E. Most systems use two layers. Primitive tokens name the raw scale (blue.600); semantic tokens name the job (button.background.primary) and point to a primitive. Dark mode or a rebrand then changes where the semantic tokens point, not every component. The Design Tokens Community Group’s format, published as a stable Final Community Group Report in October 2025, writes such a pointer as "{colors.blue}".15 It is not a W3C standard. Tokens in general are covered in → 65 Design systems, and their CSS form, custom properties, in → 74 HTML and CSS.
See also
- 13 Color basics and relationships
- 14 Color psychology and culture
- 15 Color in screen and print
- 49 Accessibility and inclusive design
- 65 Design systems
- 74 HTML and CSS
Sources
- Birch, J. (2012). “Worldwide prevalence of red-green color deficiency.” Journal of the Optical Society of America A 29(3), 313–320.
- Design Tokens Community Group (2025). Design Tokens Format Module 2025.10. Final Community Group Report, 28 October 2025.
- Kindel, E. (2005). “Ishihara.” Eye 56.
- Material Foundation. Material Color Utilities, concept documents. GitHub.
- National Eye Institute. “Types of color vision deficiency.”
- Okabe, M., and Ito, K. (2002, revised 2008). “Color Universal Design (CUD): how to make figures and presentations that are friendly to colorblind people.”
- Radix UI. “Understanding the scale.” Radix Colors documentation.
- Roselli, A. (2026). “WCAG3 contrast as of April 2026.”
- Tailwind Labs. “Colors.” Tailwind CSS documentation.
- W3C (2023). Web Content Accessibility Guidelines (WCAG) 2.2, success criteria 1.4.1, 1.4.3, 1.4.6 and 1.4.11, with Understanding documents.
Notes
- Material Foundation, Material Color Utilities, “Color terms” and “Dynamic color scheme.” https://github.com/material-foundation/material-color-utilities/tree/main/concepts ↩
- Calculated with the WCAG 2.2 relative luminance and contrast ratio formulas; see research/16-building-a-palette.md. ↩ ↩ ↩
- Tailwind Labs, “Colors.” https://tailwindcss.com/docs/colors ↩
- Radix UI, “Understanding the scale.” https://www.radix-ui.com/colors/docs/palette-composition/understanding-the-scale ↩
- Material Foundation, Material Color Utilities, “Contrast for accessibility.” https://github.com/material-foundation/material-color-utilities/blob/main/concepts/contrast_for_accessibility.md ↩
- W3C, Understanding SC 1.4.3: Contrast (Minimum). https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum.html ↩ ↩ ↩ ↩
- W3C, Understanding SC 1.4.6: Contrast (Enhanced). https://www.w3.org/WAI/WCAG22/Understanding/contrast-enhanced.html ↩
- W3C, Understanding SC 1.4.11: Non-text Contrast. https://www.w3.org/WAI/WCAG22/Understanding/non-text-contrast.html ↩
- Roselli, A. (2026). https://adrianroselli.com/2026/04/wcag3-contrast-as-of-april-2026.html ↩
- National Eye Institute, “Types of color vision deficiency.” https://www.nei.nih.gov/learn-about-eye-health/eye-conditions-and-diseases/color-blindness/types-color-vision-deficiency ↩
- Birch (2012), abstract. https://doi.org/10.1364/JOSAA.29.000313 ↩
- Okabe, M., and Ito, K. (2008). https://jfly.uni-koeln.de/color/ ↩ ↩
- W3C, Understanding SC 1.4.1: Use of Color. https://www.w3.org/WAI/WCAG22/Understanding/use-of-color.html ↩
- Kindel, E. (2005). Eye 56. https://eyemagazine.com/feature/article/ishihara ↩
- Design Tokens Community Group (2025). https://www.designtokens.org/tr/2025.10/format/ ↩