Sub topic 1
What Primary, Neutral, and Accent Colours Do
A website palette is a small, deliberate set of colours that each have a job. When a page looks unfocused, the cause is usually that colours were picked by taste, one at a time, with no job assigned to any of them. This chapter explains the three roles that organise a palette: primary, neutral, and accent. It also explains what each role is responsible for and how to spot a colour doing the wrong job.
The later chapters in this tutorial build each role in detail. Here you learn the working model they all rely on.
Prerequisites
This chapter assumes you can:
- Read and write basic HTML and CSS, including classes and the
:rootselector. - Recognise hex (
#1a66e6) and RGB (rgb(26 102 230)) colour values. - Edit a stylesheet and reload it in a browser.
You do not need to know HSL, WCAG, or design tokens yet. They get their own chapters, and this one only previews them.
Why Roles Come Before Colours
Beginners often start by asking "which blue?" Experienced designers first ask "what is this colour for?" A role is a statement of purpose, such as "the colour that marks the main action". A colour is only one possible way to fulfil it.
Starting from roles has three practical benefits:
- Fewer decisions. Instead of choosing a colour for every element, you choose three or four colours once and assign elements to roles.
- Consistency. Every button, link, and heading that serves the same purpose gets the same colour.
- Easier change. If the brand colour changes, you update the primary role and the rest of the interface follows.
The Three Roles at a Glance
| Role | Purpose | Typical elements | Saturation | Share of the page |
|---|---|---|---|---|
| Primary | Identity and main actions | Buttons, links, active navigation, logo | Medium to high | Small to moderate |
| Neutral | Structure and readability | Backgrounds, body text, borders, cards | Very low | Largest |
| Accent | Emphasis and contrast | Badges, highlights, a single call to action | High | Smallest |
The share column previews the 60-30-10 guideline, covered in its own chapter. The neutrals fill most of the page, the primary fills a moderate amount, and the accent fills a very small amount.
Primary: The Colour of Identity and Action
The primary colour is the one a visitor would use to describe your site. If you say "the blue site" or "the green app", you are naming the primary.
It does two jobs:
- Identity. It appears in the logo, headers, and illustrations, so the brand is recognisable.
- Action. It marks interactive elements such as links, buttons, focus rings, and selected tabs. When the same colour always means "you can click this", visitors learn the pattern without being told.
The second job constrains your choice. The primary must work as a background for button labels and as a text colour for links. A very pale or very bright colour is hard to use for both, and you will see why in the contrast chapter.
Choose one primary. A second brand-coloured element competing for attention weakens the signal. A secondary colour can exist, but it should be a quieter variant, not an equal.
Neutral: The Colour of Structure
Neutrals are the greys, off-whites, and near-blacks that carry most of an interface. They are the stage the other colours perform on. Neutrals handle:
- Page and card backgrounds.
- Body text and headings.
- Borders, dividers, and table lines.
- Disabled states and placeholder text.
Neutrals are not one grey. A working palette needs several steps, because text must be much darker than a border, and a border darker than a page background. A common set is four or five steps from near-white to near-black.
A neutral can be tinted slightly toward the primary hue. A grey with a small amount of blue in it sits more naturally beside a blue primary than a pure grey does. The tint should be faint. If you can name the colour, it is no longer neutral.
Neutrals matter most because users spend most of their time reading. Text contrast, line spacing, and surface separation are neutral decisions, and they decide whether a site is comfortable to use.
Accent: The Colour of Emphasis
The accent is a small amount of a contrasting colour that pulls the eye to one thing. Examples are a "New" badge, a sale price, a notification count, or the one call to action per screen.
An accent works through scarcity. If many elements use it, none stand out. A useful rule is to ask whether you could point at the accent colour on a screen and say "that is the thing to look at". If you cannot, it is overused.
An accent usually comes from a different hue than the primary. A blue primary with an orange accent is a classic pairing because the hues sit on opposite sides of the colour wheel. Later chapters cover hue relationships and how to pick an accent systematically.
Accents are optional in a minimal design. Some sites use the primary for emphasis and need no accent. Add one when the primary alone cannot separate "main brand colour" from "look here".
How the Roles Divide a Page
The diagram shows which parts of an interface each role covers.
Notice that the roles do not overlap. A given element should have one clear role. A link is primary, a divider is neutral, and a "Sale" badge is accent. When you cannot decide which role an element belongs to, the design usually needs simplifying.
A Worked Example
The following page uses all three roles. The values come from the palette this tutorial builds. Save it as index.html and open it in a browser.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Roles demo</title>
<style>
:root {
--primary-500: hsl(220 80% 50%);
--primary-700: hsl(220 80% 34%);
--neutral-50: hsl(220 15% 97%);
--neutral-300: hsl(220 12% 80%);
--neutral-900: hsl(220 20% 12%);
--accent-500: hsl(35 95% 50%);
}
body {
margin: 0;
padding: 2rem;
font-family: system-ui, sans-serif;
background: var(--neutral-50);
color: var(--neutral-900);
}
.card {
max-width: 24rem;
padding: 1.5rem;
background: white;
border: 1px solid var(--neutral-300);
border-radius: 0.5rem;
}
.badge {
display: inline-block;
padding: 0.15rem 0.5rem;
background: var(--accent-500);
color: var(--neutral-900);
font-size: 0.8rem;
font-weight: 600;
border-radius: 0.25rem;
}
a {
color: var(--primary-700);
}
button {
padding: 0.6rem 1.2rem;
background: var(--primary-500);
color: white;
border: 0;
border-radius: 0.25rem;
font-size: 1rem;
}
</style>
</head>
<body>
<div class="card">
<span class="badge">New</span>
<h1>Weekly report</h1>
<p>Your summary is ready. <a href="#">Read the details</a>.</p>
<button type="button">Download</button>
</div>
</body>
</html>Walk through the role assignments:
- Neutral: the page background (
--neutral-50), the text (--neutral-900), and the card border (--neutral-300). These cover most of the visible area. - Primary: the button background and the link colour. Both are things you can click.
- Accent: the "New" badge, a single small element.
Two choices in the code are deliberate. The badge text uses a dark neutral, because white on this orange has a contrast ratio of only about 2.3:1, well below the 4.5:1 normally required for small text. The link uses the darker --primary-700, while the button uses --primary-500. A link sits on a light background and needs more darkness to be readable as text, while white button text on the mid-blue works out to roughly 5:1. The contrast chapter shows how to calculate these numbers.
Common Errors
These mistakes appear again and again when people build a palette without roles.
- Using the accent as a second primary. If buttons, headings, and icons all use the accent, it stops signalling anything. Reserve it for one or two things per screen.
- Pure grey neutrals next to a saturated primary. The page can look disconnected, as if two palettes were combined. A faint tint toward the primary hue fixes this.
- Too few neutral steps. With only one grey, text, borders, and backgrounds fight for it. You end up making ad hoc greys in individual components.
- Meaning carried by colour alone. If red alone says "error" and green alone says "success", people with colour-vision deficiency may miss it. Add an icon or a label.
- Choosing the primary for how it looks on a swatch. A colour that looks great as a large block may fail as button text or link text. Test it in the roles it must play.
- Hard-coding colours in components. Writing
#1a66e6in twenty rules makes rebranding painful. Name the value once, then reference it.
Roles Are Not the Same as Status Colours
Success, warning, and error colours (green, amber, red) look like another role, but they behave differently. They communicate system state, not brand. They are chosen so users recognise them quickly, and they should not be replaced by your primary or accent. A later chapter adds them as a separate, semantic layer on top of the core three.
Where This Leads
The remaining chapters follow the order in which you would build a palette:
- Learn HSL so you can describe colours by hue, saturation, and lightness.
- Choose the primary, build the neutrals, and pick the accent.
- Balance them with the 60-30-10 guideline.
- Expand each into a scale of shades.
- Check contrast against WCAG.
- Add status colours.
- Store everything as CSS custom properties.
- Adapt it for dark mode.
- Test and document the result.
Each step refines the three roles from this chapter. If you keep the roles clear, the later technical steps stay manageable.
Exercise
A site uses a blue primary. Its designer also uses the orange accent for the navigation links, the page headings, the footer background, and every button. Name two problems this causes and describe how you would reassign the roles.
Show answer
First, the accent loses its purpose. When orange appears on many elements, it cannot draw the eye to anything, so emphasis is lost. Second, the links and buttons no longer share the primary colour, so visitors cannot learn that blue means clickable. Reassign as follows. Links and buttons use the primary blue. Headings and the footer use neutrals, such as a dark neutral for headings and a light or dark neutral for the footer. Orange is kept for one or two items per screen, such as a badge or the single main call to action.
Exercise
You need a colour for the 1px border of a card on a near-white page, and a colour for body text on the same page. Which role covers both, and why do they need different steps?
Show answer
Both are neutrals. They need different steps because they do different jobs. Body text must be very dark to be readable against the near-white background, so it uses a step near the dark end of the scale. A border only needs to be visible as a faint line, so it uses a light-to-mid step. Using one grey for both would make the border too heavy or the text too faint.