Guides

Website color schemes: roles, ratios and real examples

Updated 2026-09-14 · 4 min read · by the ColorSwoop team

A palette is a list of colors. A color scheme is a palette with jobs. Here is how to hand out the jobs — and what a page looks like once every color has one.

The five roles every site needs

Background · Text · Primary · Secondary · Accent
ColorSwoop's own scheme, in role order. Two neutrals do most of the work; the brand color appears only where something can be clicked.
  • Background: the lightest neutral (or darkest, in dark mode). Used everywhere.
  • Text: a near-black or near-white with at least 4.5:1 contrast against the background.
  • Primary: your brand color. Buttons, links, active states.
  • Secondary: a calmer companion for cards, sections and secondary buttons.
  • Accent: a small, vivid color for badges, highlights and success/warning states.

Here is a catalogue palette with the roles assigned by lightness, the way every palette page's UI preview does it:

BrandFeaturesPricingBlogGet started

A page is where a palette becomes a scheme

Four colors, one page: background, text, a primary action and an accent — the roles a real interface needs.

Primary action Secondary
Card title
Card title
Card title
Background #DDE6ED · text #27374D · primary #526D82 · accent #9DB2BF — open Slate Studio

The 60-30-10 rule

Background and surfaces take about 60% of the pixels, secondary areas about 30%, primary and accent about 10%. If a page looks busy, the accent is almost always over its 10%.

Background & surfaces · 60% #DDE6EDSecondary areas · 30% #526D82Primary & accent · 10% #27374D
Slate Studio split by the rule. The proportion is what makes a page feel calm; the same colors at 33/33/33 would feel like a flag.
✕ Accent everywhere
✓ Accent on the one thing to click
Same palette. When the vivid color covers 40% of the page nothing stands out; at 10% it points.

Example schemes by industry

Category expectations are real, so a scheme usually starts from what the reader already trusts and departs from it in one place. Each of these is a real palette you can open and export.

SaaS / tech (slate and a confident blue) · lifestyle / e-commerce (warm off-white, mocha) · finance / premium (charcoal, gold, marble white).
Developer tools / gaming (near-black with a neon accent) · health / wellness (soft greens on white) · travel / consumer (bright blues, plenty of white).
  • SaaS / tech: white or a cool off-white background, near-black text, a confident blue or violet primary, one green or orange accent. Browse tech palettes.
  • E-commerce / lifestyle: warm off-white, charcoal text, terracotta or sage primary. See earthy and boho.
  • Finance / legal: navy, gray and a single gold or teal accent. See luxury and gold.
  • Gaming / developer tools: near-black background, light text, neon accent. See dark and neon.
  • Health / wellness: soft greens and blues on white. See nature and pastel.

Implementing it in CSS

Define the roles as custom properties so the scheme lives in one place and dark mode is a five-line override:

:root {
  --bg: #FFFFFF;      --text: #141416;
  --primary: #5B3DF5; --secondary: #E9E5FF; --accent: #FF5C8A;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0F0F12; --text: #F2F2F5; --secondary: #24203F; }
}
.button { background: var(--primary); color: #fff; }

Dark mode

Swap background and text, keep the primary hue but reduce its saturation 10–20% so it does not vibrate, and raise the lightness of the secondary so cards remain visible. The same palette, inverted:

BrandFeaturesPricingBlogGet started

The same scheme with the roles inverted

Four colors, one page: background, text, a primary action and an accent — the roles a real interface needs.

Primary action Secondary
Card title
Card title
Card title
Slate Studio with background and text swapped. Notice the cards still separate from the page — that is the secondary doing its job. The dark mode guide covers the rest.

Test both modes with the contrast checker; the dark mode guide has the rules that are specific to dark.

FAQ

What is the best color scheme for a website?

The most reliable formula is a neutral background, a dark neutral for text, one primary brand color for actions and one accent for highlights. Trustworthy blues and clean grays dominate SaaS; warm neutrals and terracotta suit lifestyle brands; dark backgrounds with a neon accent suit gaming and developer tools.

How many colors should a website use?

Three to five including neutrals. Two neutrals (background and text), one primary, one accent and optionally one secondary is enough for almost every site.

Should my website have a dark mode?

Increasingly yes. Design the light palette first, then create a dark variant by swapping background and text and slightly desaturating accents so they do not glow.