Sub topic 1
What primary, neutral, and accent colours do
Prerequisites
This chapter assumes you can:
- Read and write basic HTML and CSS.
- Recognise hex (
#1a73e8) and RGB (rgb(26 115 232)) colour values. - Edit a stylesheet and view the result in a browser.
You do not need to know HSL, WCAG, or design tokens yet. Later chapters cover them.
Why a palette needs roles
A website that uses colours without a plan tends to drift. One button is blue, another is a slightly different blue, and a warning banner uses a third shade picked in a hurry. A palette fixes this by limiting the colours you use and assigning each one a job.
Most interface palettes divide the work into three roles:
- Primary is the colour of your brand and your main actions.
- Neutral colours carry text, backgrounds, and borders.
- Accent is a contrasting colour that draws attention to a few things.
Each role answers a different question. Primary answers "what is this site's identity, and what should I click?" Neutral answers "how do I make content readable and organised?" Accent answers "what deserves extra notice right now?"
Primary colour
The primary colour is the one people remember. You use it for the elements that define the interface:
- The main call-to-action button
- Links
- The active item in a navigation bar
- Focus rings and selected states
Because it marks the important actions, you should use it with restraint. If every element is blue, nothing stands out. A single primary hue, repeated consistently, teaches visitors where to click.
Neutral colours
Neutrals are the colours with little or no saturation: whites, greys, near-blacks. They are not exciting, but they make up most of what a visitor sees. You use them for:
- Page and card backgrounds
- Body text and headings
- Borders, dividers, and disabled states
A common mistake is to treat neutrals as pure grey. Pure grey can look flat next to a coloured primary. Many designers tint their neutrals slightly toward the primary hue, so that the greys feel like they belong to the same palette. The next chapters show how to do this.
Accent colours
An accent is a second colour that contrasts with the primary. It is for moments of emphasis: a "New" badge, a highlighted price, a sale banner, or a notification dot. Because the accent is rare, it catches the eye. If you use it as widely as the primary, it loses that effect and the two colours compete.
How the roles divide a page
The roles are not equal in size. Neutrals cover most of the surface, the primary appears on key actions, and the accent shows up only occasionally.
The roles in code
Here is a small example. Notice how little of the page uses the primary and accent colours.
:root {
--neutral-50: #f6f7f9;
--neutral-900: #171c26;
--neutral-300: #cbd0d9;
--primary-500: #1a5ce6;
--accent-500: #f59f0a;
}
body {
background: var(--neutral-50);
color: var(--neutral-900);
}
.card {
border: 1px solid var(--neutral-300);
}
.button {
background: var(--primary-500);
color: white;
}
.badge {
background: var(--accent-500);
color: var(--neutral-900);
}The page background, text, and card border all use neutrals. The button uses the primary. The badge uses the accent. If you later change the brand colour, you edit one value and every primary element updates.
Common mistakes
| Mistake | Effect | Fix |
|---|---|---|
| Using several bright colours at equal weight | The page feels busy, with no clear action | Pick one primary and keep the rest quiet |
| Using the accent everywhere | The accent stops signalling importance | Reserve it for a few highlights |
| Pure grey neutrals | The page looks disconnected from the brand | Tint neutrals toward the primary hue |
| Relying on colour alone to carry meaning | Some users cannot tell the difference | Pair colour with text or icons |
Exercises
Exercise
A site's "Buy now" button, its links, and its sale badge are all the same bright orange. Which role is being misused, and what would you change?
Show answer
The accent role is being merged with the primary. The button and links should use the primary colour, because they are the main actions. The sale badge should use a contrasting accent colour, so it stands out as a rare highlight.
Exercise
Which of the three roles should cover the largest area of a typical page, and why?
Show answer
Neutrals. They make up backgrounds, text, and borders, which together cover most of the page. This keeps content readable and lets the primary and accent stand out.