Sub topic 5
Picking an accent colour
This chapter assumes you have a primary colour and a neutral scale, and that you can read HSL values (hue, saturation, lightness) from the earlier chapters. The accent is the third role. You use it to draw the eye to a small number of things.
What the accent is for
The primary colour carries your brand. The neutrals carry text and surfaces. The accent marks the things you want noticed: a call-to-action button, a badge, a highlighted price, or a selected tab.
An accent only works if it is rare. If it appears on every heading, link, and icon, nothing stands out any more. Choose it for how well it contrasts with the primary, not for how well it matches.
Use the hue wheel
In HSL, hue is an angle from 0 to 360 degrees around a colour wheel. Hue relationships give you accent candidates by simple arithmetic on the primary's hue. The table uses the primary from the earlier chapters, hsl(220 80% 50%), where the hue is 220.
| Relationship | Rule | Accent hue for primary 220 | Effect |
|---|---|---|---|
| Analogous | primary ± 30 | 190 or 250 | Calm, low contrast with the primary |
| Complementary | primary + 180 | 40 | Strongest contrast |
| Split-complementary | primary + 150 or − 150 | 10 or 70 | Strong contrast, less harsh |
| Triadic | primary + 120 or − 120 | 340 or 100 | Lively, harder to balance |
Blue (220) and orange (about 40) are complements, which is why the palette in this tutorial uses hsl(35 95% 50%). The hue is nudged from 40 to 35 because that orange looks warmer and less yellow on screen. Treat the wheel as a starting point and adjust by eye.
Set saturation and lightness
The hue only picks the colour family. Saturation and lightness decide whether the accent works.
- Saturation: keep it high, usually 70% to 100%. A muted accent next to a saturated primary looks like a mistake.
- Lightness: keep it near the primary's lightness, or slightly brighter, so the two feel like one palette. Do not copy the primary's exact value, or they compete.
- Neutrals: the neutrals are tinted toward the primary hue, so the accent contrasts with them as well.
Define the accent as a single mid-tone first. You expand it into a scale in a later chapter.
:root {
--primary-500: hsl(220 80% 50%);
/* Complement of 220 is 40; nudged to 35 for a warmer orange */
--accent-500: hsl(35 95% 50%);
}
.button-primary {
background: var(--primary-500);
color: white;
}
.badge-new {
background: var(--accent-500);
color: hsl(220 20% 12%); /* dark text, see the warning below */
}Common errors
Using the accent as text colour on a light background. An orange at 50% lightness has a contrast ratio of roughly 2.2:1 against white, which fails WCAG for normal text (4.5:1). Dark text on top of the orange passes easily. The next chapters cover how to calculate this exactly.
Using more than one accent. Two accents compete with each other and with the primary. If you need more colours, use status colours (success, warning, error), which have their own job.
Using the accent for interactive and non-interactive things. Users learn that the accent means "act here". If you also use it for decoration, the signal gets weaker.
Picking an accent too close to a status colour. An orange accent can be confused with a warning colour. If your accent is orange, make the warning colour a distinctly more yellow shade, or move the accent to another hue.
Summary of the working model
- Take the primary hue.
- Add or subtract an angle to get a candidate hue.
- Set high saturation and a lightness close to the primary's.
- Check that text on or under the accent meets contrast.
- Reserve it for a handful of elements per page.
Exercise
Your primary colour is hsl(150 60% 40%). Find its complementary hue and one split-complementary hue. Then name one risk of using the complement directly as an accent for body text on a white background.
Show answer
The complement is 150 + 180 = 330. The split-complementary hues are 150 + 150 = 300 and 150 − 150 = 0 (red). The risk is contrast: a saturated pink or magenta at mid lightness is likely to fall below 4.5:1 against white, so it should be used as a background with dark text, or as a darker shade, rather than as body text colour.