Direct answer
A website color palette assigns a color to each job on the page: background, surface, text, muted text, accent and the label on the accent. The ten palettes below give hex codes for each role, and every text pair passes WCAG 2.1 AA at 4.5:1 or more, with the computed ratio printed beside it.

A website color palette is a set of roles, not a set of swatches
Every color on a page has a job: page background, card surface, body text, secondary text and the accent for buttons and links. Pick the roles first. Then choose a color for each role.
Material Design names the same idea. A surface role covers backgrounds and large low-emphasis areas. Primary is the accent for high-emphasis elements. A role that starts with "on", such as on primary, is the color for text and icons placed on top of its paired color. Material applies colors only in these intended pairs, so the contrast holds.
Apple's guidelines add two rules: do not use the same color to mean different things, and make sure every color works in light and dark appearances.
- Background: the page itself.
- Surface: cards, panels and alternate sections.
- Text: headings and body copy.
- Muted text: captions, labels and metadata.
- Accent: buttons, links and focus states.
- Text on accent: the label inside a filled button.
Website color palette in four steps
The four steps, in the order you take them.

- Step 1: Name the color roles
- Step 2: Pick a hue for each role
- Step 3: Check every text pair
- Step 4: Store roles as CSS variables
Every text pair below passes WCAG AA, and the ratio is printed beside it
WCAG 2.1 success criterion 1.4.3 asks for a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text. Large text means at least 18 point, or 14 point bold. Criterion 1.4.11 asks for 3:1 for the visual information needed to identify a control and its state, such as an input's border or a focus ring. A button whose text label identifies it does not need a contrasting fill or boundary.
The contrast ratio is (L1 + 0.05) / (L2 + 0.05), where L1 is the relative luminance of the lighter color and L2 of the darker one. It runs from 1:1 to 21:1. W3C says not to round the result up: 4.499:1 does not meet 4.5:1. Each ratio here was computed from the hex codes with that formula and cut to two decimals, never rounded up.
Every text color in these palettes clears 4.5:1 on both the background and the surface. So you can use any of them for body text, not just headings.
1. Calm SaaS blue: white page, slate text, deep blue buttons
A safe default for software, B2B services and documentation. The blue is a shade darker than the usual bright product blue, so white button labels stay readable.
| Role | Hex | Use and contrast |
|---|---|---|
Background | Hex #FFFFFF | Use and contrast Page background. Text on it: 17.85:1, passes AA for body text. |
Surface | Hex #F1F5F9 | Use and contrast Cards and alternate sections. Text on it: 16.29:1, passes AA for body text. |
Text | Hex #0F172A | Use and contrast Headings and body copy. |
Muted text | Hex #475569 | Use and contrast Captions and labels. 7.57:1 on background, 6.91:1 on surface, both pass AA for body text. |
Accent | Hex #1D4ED8 | Use and contrast Buttons and links. As link text: 6.70:1 on background, passes AA for body text. Against the surface: 6.11:1. |
Text on accent | Hex #FFFFFF | Use and contrast Button labels. 6.70:1 on the accent, passes AA for body text. |
2. Warm editorial: cream page, brown-black text, rust links
Suits blogs, magazines and agencies that want a printed feel. Rust works for links and buttons on the cream page and on the beige cards.
| Role | Hex | Use and contrast |
|---|---|---|
Background | Hex #FAF7F2 | Use and contrast Page background. Text on it: 14.00:1, passes AA for body text. |
Surface | Hex #F0E9DD | Use and contrast Cards and alternate sections. Text on it: 12.40:1, passes AA for body text. |
Text | Hex #2B2622 | Use and contrast Headings and body copy. |
Muted text | Hex #5C534A | Use and contrast Captions and labels. 7.04:1 on background, 6.23:1 on surface, both pass AA for body text. |
Accent | Hex #B4441E | Use and contrast Buttons and links. As link text: 5.19:1 on background, passes AA for body text. Against the surface: 4.59:1. |
Text on accent | Hex #FFFFFF | Use and contrast Button labels. 5.54:1 on the accent, passes AA for body text. |
3. Ecommerce orange: white page, near-black text, burnt orange buy buttons
Built for shops. Bright orange fails with white labels, so this palette uses a burnt orange that holds white text.
| Role | Hex | Use and contrast |
|---|---|---|
Background | Hex #FFFFFF | Use and contrast Page background. Text on it: 17.48:1, passes AA for body text. |
Surface | Hex #FFF4EC | Use and contrast Cards and alternate sections. Text on it: 16.15:1, passes AA for body text. |
Text | Hex #1C1917 | Use and contrast Headings and body copy. |
Muted text | Hex #57534E | Use and contrast Captions and labels. 7.62:1 on background, 7.04:1 on surface, both pass AA for body text. |
Accent | Hex #C2410C | Use and contrast Buttons and links. As link text: 5.17:1 on background, passes AA for body text. Against the surface: 4.78:1. |
Text on accent | Hex #FFFFFF | Use and contrast Button labels. 5.17:1 on the accent, passes AA for body text. |
4. Forest wellness: pale sage page, deep green text and buttons
For natural products, farms and wellness brands. The green is dark enough to carry white labels, which a mid green cannot.
| Role | Hex | Use and contrast |
|---|---|---|
Background | Hex #F6F8F4 | Use and contrast Page background. Text on it: 13.94:1, passes AA for body text. |
Surface | Hex #E7EEE3 | Use and contrast Cards and alternate sections. Text on it: 12.58:1, passes AA for body text. |
Text | Hex #1F2A1F | Use and contrast Headings and body copy. |
Muted text | Hex #4D5B4C | Use and contrast Captions and labels. 6.73:1 on background, 6.08:1 on surface, both pass AA for body text. |
Accent | Hex #2F6B3A | Use and contrast Buttons and links. As link text: 5.98:1 on background, passes AA for body text. Against the surface: 5.39:1. |
Text on accent | Hex #FFFFFF | Use and contrast Button labels. 6.39:1 on the accent, passes AA for body text. |
5. Teal health: white page, dark teal text, teal buttons
For clinics, health services and insurance. Teal reads calm and still passes with white labels at this depth.
| Role | Hex | Use and contrast |
|---|---|---|
Background | Hex #FFFFFF | Use and contrast Page background. Text on it: 15.07:1, passes AA for body text. |
Surface | Hex #EEF7F7 | Use and contrast Cards and alternate sections. Text on it: 13.84:1, passes AA for body text. |
Text | Hex #102A2E | Use and contrast Headings and body copy. |
Muted text | Hex #3F5B5F | Use and contrast Captions and labels. 7.30:1 on background, 6.71:1 on surface, both pass AA for body text. |
Accent | Hex #0F766E | Use and contrast Buttons and links. As link text: 5.47:1 on background, passes AA for body text. Against the surface: 5.02:1. |
Text on accent | Hex #FFFFFF | Use and contrast Button labels. 5.47:1 on the accent, passes AA for body text. |
6. Violet product: lavender-white page, indigo text, violet buttons
Common for AI tools, online courses and creative software. The deep violet holds both white labels and link text.
| Role | Hex | Use and contrast |
|---|---|---|
Background | Hex #FCFBFF | Use and contrast Page background. Text on it: 15.51:1, passes AA for body text. |
Surface | Hex #F3F0FF | Use and contrast Cards and alternate sections. Text on it: 14.25:1, passes AA for body text. |
Text | Hex #1E1B4B | Use and contrast Headings and body copy. |
Muted text | Hex #4C4870 | Use and contrast Captions and labels. 8.25:1 on background, 7.58:1 on surface, both pass AA for body text. |
Accent | Hex #6D28D9 | Use and contrast Buttons and links. As link text: 6.89:1 on background, passes AA for body text. Against the surface: 6.33:1. |
Text on accent | Hex #FFFFFF | Use and contrast Button labels. 7.10:1 on the accent, passes AA for body text. |
7. Mono with one red: white and gray, one red for actions
For portfolios, studios and news sites. Black and gray carry the content and the single red marks what to click.
| Role | Hex | Use and contrast |
|---|---|---|
Background | Hex #FFFFFF | Use and contrast Page background. Text on it: 17.71:1, passes AA for body text. |
Surface | Hex #F4F4F5 | Use and contrast Cards and alternate sections. Text on it: 16.11:1, passes AA for body text. |
Text | Hex #18181B | Use and contrast Headings and body copy. |
Muted text | Hex #52525B | Use and contrast Captions and labels. 7.72:1 on background, 7.03:1 on surface, both pass AA for body text. |
Accent | Hex #C8102E | Use and contrast Buttons and links. As link text: 5.88:1 on background, passes AA for body text. Against the surface: 5.35:1. |
Text on accent | Hex #FFFFFF | Use and contrast Button labels. 5.88:1 on the accent, passes AA for body text. |
8. Pastel friendly: warm white page, plum text, berry buttons
For kids' brands, events and lifestyle shops. Pastel fills stay as backgrounds. The text and buttons use dark tones so they stay readable.
| Role | Hex | Use and contrast |
|---|---|---|
Background | Hex #FFFDF8 | Use and contrast Page background. Text on it: 13.67:1, passes AA for body text. |
Surface | Hex #FDEFF4 | Use and contrast Cards and alternate sections. Text on it: 12.46:1, passes AA for body text. |
Text | Hex #2E2A3B | Use and contrast Headings and body copy. |
Muted text | Hex #5A5468 | Use and contrast Captions and labels. 7.11:1 on background, 6.48:1 on surface, both pass AA for body text. |
Accent | Hex #B83280 | Use and contrast Buttons and links. As link text: 5.42:1 on background, passes AA for body text. Against the surface: 4.94:1. |
Text on accent | Hex #FFFFFF | Use and contrast Button labels. 5.51:1 on the accent, passes AA for body text. |
9. Dark developer: near-black page, light gray text, green actions
For developer tools and technical docs. The page is near-black rather than pure black, and the green button takes dark text.
| Role | Hex | Use and contrast |
|---|---|---|
Background | Hex #0D1117 | Use and contrast Page background. Text on it: 16.01:1, passes AA for body text. |
Surface | Hex #161B22 | Use and contrast Cards and alternate sections. Text on it: 14.63:1, passes AA for body text. |
Text | Hex #E6EDF3 | Use and contrast Headings and body copy. |
Muted text | Hex #9DA7B3 | Use and contrast Captions and labels. 7.76:1 on background, 7.09:1 on surface, both pass AA for body text. |
Accent | Hex #3FB950 | Use and contrast Buttons and links. As link text: 7.44:1 on background, passes AA for body text. Against the surface: 6.80:1. |
Text on accent | Hex #0D1117 | Use and contrast Button labels. 7.44:1 on the accent, passes AA for body text. |
10. Dark violet: deep ink page, soft white text, light violet actions
For creative and AI products with a dark look. Light violet works as link text and as a button fill with dark labels.
| Role | Hex | Use and contrast |
|---|---|---|
Background | Hex #0B0B12 | Use and contrast Page background. Text on it: 15.83:1, passes AA for body text. |
Surface | Hex #1A1A2E | Use and contrast Cards and alternate sections. Text on it: 13.77:1, passes AA for body text. |
Text | Hex #E5E7EB | Use and contrast Headings and body copy. |
Muted text | Hex #A1A1B5 | Use and contrast Captions and labels. 7.73:1 on background, 6.72:1 on surface, both pass AA for body text. |
Accent | Hex #A78BFA | Use and contrast Buttons and links. As link text: 7.20:1 on background, passes AA for body text. Against the surface: 6.26:1. |
Text on accent | Hex #0B0B12 | Use and contrast Button labels. 7.20:1 on the accent, passes AA for body text. |
All ten palettes at a glance
Both columns must reach 4.5:1 for body-size text. The lowest value in the table is the button label in Ecommerce orange.
| Palette | Text on background | Label on button |
|---|---|---|
Calm SaaS blue | Text on background 17.85:1 | Label on button 6.70:1 |
Warm editorial | Text on background 14.00:1 | Label on button 5.54:1 |
Ecommerce orange | Text on background 17.48:1 | Label on button 5.17:1 |
Forest wellness | Text on background 13.94:1 | Label on button 6.39:1 |
Teal health | Text on background 15.07:1 | Label on button 5.47:1 |
Violet product | Text on background 15.51:1 | Label on button 7.10:1 |
Mono with one red | Text on background 17.71:1 | Label on button 5.88:1 |
Pastel friendly | Text on background 13.67:1 | Label on button 5.51:1 |
Dark developer | Text on background 16.01:1 | Label on button 7.44:1 |
Dark violet | Text on background 15.83:1 | Label on button 7.20:1 |
Popular bright colors fail as button fills with white text
Many palette lists pair white labels with bright mid-tone accents. The ratios below show why those buttons are hard to read, and the darker shade that fixes each one.
| Pair | Ratio | Fix |
|---|---|---|
White on #10B981 (mid green) | Ratio 2.53:1, fails AA | Fix Use dark text on it, or a darker green such as #2F6B3A. |
White on #F97316 (bright orange) | Ratio 2.80:1, fails AA | Fix Use #C2410C for the button fill. |
White on #3B82F6 (bright blue) | Ratio 3.67:1, passes AA for large text only | Fix Large bold labels only, or switch to #1D4ED8. |
#9CA3AF gray text on white | Ratio 2.53:1, fails AA | Fix Use #475569 or darker for muted text. |
#777777 gray text on white | Ratio 4.47:1, passes AA for large text only | Fix Misses 4.5:1 by a hair. #767676 reaches it. |
Store the roles as CSS variables and swap them for dark mode
Name each variable after its role, not its color. Then a dark theme only changes the values. The prefers-color-scheme media feature detects whether the user asked for a light or dark theme in the operating system or browser. MDN describes the common pattern: ship light colors by default and override them inside prefers-color-scheme: dark.
The example below pairs palette 1 with palette 9. Both sets pass AA on their own, so the page passes in either mode. Check the dark set separately, because a pair that passes on white can fail on near-black.
:root {
--background: #FFFFFF;
--surface: #F1F5F9;
--text: #0F172A;
--text-muted: #475569;
--accent: #1D4ED8;
--on-accent: #FFFFFF;
}
@media (prefers-color-scheme: dark) {
:root {
--background: #0D1117;
--surface: #161B22;
--text: #E6EDF3;
--text-muted: #9DA7B3;
--accent: #3FB950;
--on-accent: #0D1117;
}
}
body { background: var(--background); color: var(--text); }
.button { background: var(--accent); color: var(--on-accent); }A generator or a photo gives you hues, and you still assign the roles
Palette generators, including ones that pull colors from an image, return a row of swatches. They do not know which swatch will hold your body text. Take the hue you like, then darken it for the accent and lighten it for the surface until each pair clears the ratio.
Keep color from carrying meaning alone. WCAG's non-text contrast rule asks for 3:1 on whatever identifies a control or its state, such as an input border, a checkbox or a focus ring, so it stays visible to someone who cannot tell the hues apart.
Steal this workflow
Run this guide in your own assistant. The prompt carries the guide link and the workflow summary, so the assistant can adapt it to your project.
Read the guide "Website Color Palette: 10 Schemes with Tested Contrast" at https://better-design.com/blog/website-color-palette and help me apply it to my project.
A website color palette assigns a color to each job on the page: background, surface, text, muted text, accent and the label on the accent. The ten palettes below give hex codes for each role, and every text pair passes WCAG 2.1 AA at 4.5:1 or more, with the computed ratio printed beside it.
Start by asking what I am building and which tools I use. Then walk me through the workflow step by step, adapted to my answers.Claude and ChatGPT open with the prompt filled in. Gemini copies the prompt to your clipboard first, so paste it when the app opens.
Questions
What is the best color palette for a website?
The best palette is one whose text and button pairs pass WCAG AA and whose accent fits the brand. A white or near-white background, a near-black text color and one dark accent is the safest start. Calm SaaS blue in this guide scores 17.85:1 for text and 6.70:1 for button labels.
How many colors should a website palette have?
Count roles instead of colors. The palettes here use six roles: background, surface, text, muted text, accent and text on accent. Add a second accent only when a page needs to tell two kinds of action apart, and never use one color for two meanings.
What contrast ratio does website text need?
WCAG 2.1 level AA asks for at least 4.5:1 for normal text and 3:1 for large text, meaning 18 point or 14 point bold. The parts that identify a control or its state, such as input borders and focus rings, need 3:1 against the colors next to them. Do not round up: 4.499:1 fails.
How do I make a website color palette from an image?
Pull the main hues from the image with a palette generator, then assign roles. Use a light tint for the background and surface, a near-black for text, and darken the strongest hue until white text on it reaches 4.5:1. Check every pair before you use it.
Does a website need a dark color palette too?
Not always, but users can ask for one through the prefers-color-scheme setting, and Apple's guidelines ask for colors that work in both light and dark. Store your roles as CSS variables and give the dark set its own tested values.
Where these rules come from
Each fact comes from W3C, MDN, Material Design and Apple's own guidance, with every contrast ratio computed for this guide, read on November 15, 2026.
Related
Build the interface in your own code instead
A coding agent such as Claude Code, Cursor or Codex can build these screens in your own code. Better Design gives that agent a design system, interface principles and review rules, so the result follows rules like these and looks designed.