How to Choose a Color Scheme for a Website
· 5 min read
A practical way to turn a palette into a website color scheme: assign background, text, primary and accent roles, balance them and test the result.
Most color palettes are presented as a row of five swatches. That is a good way to judge whether colors look nice together and a poor way to judge whether they will work on a website. A site does not use five colors equally. It uses one color for almost every pixel, another for nearly all of the text, and the rest in small, deliberate doses. Choosing a website color scheme is mostly about deciding which color plays which part.
This guide walks through that decision step by step, from a raw palette to a scheme you can ship.
Think in roles, not colors
A typical interface needs a small set of roles. Each one has a job, and each job comes with its own requirements:
| Role | What it does | What it needs |
|---|---|---|
| Background | The page itself; covers most of the screen | Calm, low saturation, very light or very dark |
| Surface | Cards, panels, inputs, menus | A small step away from the background |
| Border | Dividers and outlines | Visible but quiet |
| Text | Body copy and headings | Strong contrast with background and surface |
| Muted text | Captions, hints, metadata | Less emphasis, but still readable |
| Primary | Main buttons, links, active states | Recognizable as the brand; stands out from the background |
| Accent | Highlights, badges, secondary emphasis | Clearly different from primary, but in the same family of feeling |
Once you think this way, a palette stops being a set of equals. A saturated orange might be a beautiful color, but it would be an exhausting background. A pale cream is forgettable as a button, but it can be a perfect page color.
Step 1: Pick the background first
The background decides the mood more than any other color, simply because there is so much of it. Look at the lightest and darkest colors in your palette. For a light theme, the lightest color is usually the background; for a dark theme, the darkest.
If the lightest color is strongly tinted — a bright yellow or a saturated pink — it will tire the eye over a long session. Pull its saturation down until it reads as a tinted white rather than a color. A background with a slight warm or cool tint feels more designed than pure white, and it gives the rest of the palette something to relate to.
Warm off-white, cool off-white and pure white. Each sets a different tone before anything else is on the page.
Step 2: Make sure the text can be read
Text is the second-largest area on most pages, and it has the strictest requirement: it has to be readable. The darkest palette color is the natural candidate, but check its contrast against the background before you commit. Body text should reach at least 4.5:1 to meet WCAG AA, and 7:1 is a comfortable target for long reading. Our contrast guide explains the numbers in detail.
If the palette's darkest color is not dark enough, darken it rather than replacing it. Keeping the hue and only lowering the lightness preserves the palette's character — a deep navy text still feels connected to a blue palette, where switching to black would not. Muted text is then a step between text and background, and it should still clear 4.5:1.
Step 3: Choose the primary color
The primary color is the one people associate with the product. It marks the main call to action, links and selected states. It usually comes from the middle of the palette: the most saturated color that is neither the lightest nor the darkest.
Two checks matter here:
- Against the background: a filled button needs at least 3:1 contrast with the page so its shape is visible.
- Against its label: the text on the button needs at least 4.5:1. Try both white and a very dark color on the primary and keep whichever passes with more room.
Step 4: Add an accent — sparingly
The accent gives the interface a second voice: a badge, a highlight in a chart, a notification dot. Pick a color whose hue is clearly different from the primary, otherwise the two will be confused. Complementary or split-complementary choices work well; see color harmony for interfaces for how each one behaves.
The accent should be rare. If it shows up on every card, it stops pointing at anything. A common rule of thumb is the 60-30-10 split: roughly 60% background, 30% surfaces and text, 10% primary and accent. It is not a law, but it is a useful sanity check when a layout feels noisy.
Step 5: Derive surfaces and borders
Surfaces and borders rarely come directly from a palette. Instead, derive them from the background: move a few steps toward the text color for a surface, and a few more for a border. Because they are mixed from colors already in the scheme, they stay in harmony automatically. On a light theme a surface might be slightly darker than the background; on a dark theme, slightly lighter.
Step 6: Build the dark version from the same palette
A dark theme is not an inverted light theme. Start again from the opposite end of the palette: the darkest color becomes the background, a light color becomes the text, and saturated colors usually need to be toned down so they do not glow. The dark mode guide covers this in detail.
Step 7: Test it on a real layout
The final test is always visual. Put the scheme on a page with a header, a few paragraphs, a form, a table and two buttons. Problems that are invisible in a swatch row show up immediately: a border that disappears, a muted text that is too faint, an accent that competes with the primary.
This is exactly what every palette on Colorset does. Each one is assigned these roles automatically, corrected for contrast where needed, and shown on a website, a dashboard and a mobile app in both light and dark mode. You can also start from a single brand color in the palette generator and get a complete scheme back.
Quick checklist
- Background chosen for mood, with low saturation.
- Body text at 4.5:1 or more against background and surface.
- Primary button visible against the page (3:1) and readable label (4.5:1).
- Accent clearly different from primary and used sparingly.
- Surfaces and borders derived from the background.
- Dark theme built separately, not inverted.
- Everything checked on a real layout.