Sub topic 13
Building a cohesive palette step by step
This chapter assumes you know hue, saturation, and value, the color wheel, and how tints, tones, and shades work. It also assumes you can read short CSS and Python. Here you combine those ideas into a small working palette.
The working model
A cohesive palette is a set of colors that share a few properties and differ in a few others, on purpose. Hue picks the family. Saturation sets the energy. Value sets the hierarchy. Vary one property at a time, and keep the others fixed or tied together by a rule.
Step 1: Choose a base hue
Pick one hue that fits the message of the design. Blue at 210° reads as calm and trustworthy. This hue will cover most of the interface.
Step 2: Pick a harmony for the accent
Use the wheel to choose a second hue. An analogous hue (±30°) stays quiet. A complement (+180°) gives strong contrast and works best in small amounts. For a blue at 210°, the complement is 30°, an orange.
Step 3: Build value ramps
For each hue, create a ramp of lightness steps. Keep saturation close to constant, then lower it a little at the light and dark ends. Very light and very dark colors look garish when fully saturated.
Step 4: Assign roles
Give every color a job. A common split is roughly 60% neutral, 30% base hue, and 10% accent. The neutrals should be tinted toward the base hue with low saturation (5–15%). Pure gray tends to look disconnected from a colored palette.
Step 5: Check contrast
Text and background need enough value difference. For normal text, WCAG asks for a contrast ratio of at least 4.5:1. If a pair fails, change the value of one color, not its hue.
Example in CSS
:root {
--base-hue: 210;
--accent-hue: 30; /* complement of 210 */
/* base ramp: same hue, value changes, saturation eases at the ends */
--base-100: hsl(var(--base-hue) 60% 95%);
--base-300: hsl(var(--base-hue) 70% 75%);
--base-500: hsl(var(--base-hue) 80% 45%);
--base-700: hsl(var(--base-hue) 75% 28%);
--base-900: hsl(var(--base-hue) 60% 14%);
/* neutrals: low saturation, same hue */
--neutral-50: hsl(var(--base-hue) 10% 97%);
--neutral-600: hsl(var(--base-hue) 10% 35%);
/* accent: used sparingly */
--accent: hsl(var(--accent-hue) 90% 50%);
}
body {
background: var(--neutral-50);
color: var(--base-900);
}
button {
background: var(--accent);
color: var(--base-900);
}Changing --base-hue shifts the whole base ramp and the neutrals together. The accent stays separate. If you want it to follow the base, set --accent-hue: calc(var(--base-hue) + 180).
Example in Python
This script builds a value ramp from HSV and prints hex codes.
import colorsys
def to_hex(h, s, v):
r, g, b = colorsys.hsv_to_rgb(h / 360, s, v)
return "#{:02x}{:02x}{:02x}".format(round(r * 255), round(g * 255), round(b * 255))
hue = 210
steps = [(0.25, 0.98), (0.45, 0.90), (0.75, 0.75), (0.85, 0.50), (0.80, 0.25)]
for saturation, value in steps:
print(to_hex(hue, saturation, value))Each step lowers the value. Saturation rises through the middle of the ramp and falls at the light end, so the lightest color stays soft.
Common errors
- Every color saturated. Nothing stands out. Keep most of the palette muted and reserve high saturation for one accent.
- Similar values everywhere. The design looks flat and fails contrast checks. Squint at the design or view it in grayscale to see the value structure.
- Too many hues. Start with one base hue and one accent. Add more only when a role needs it.
- Trusting numbers over eyes. Equal HSL lightness does not look equally light across hues, so check the result visually and measure contrast.
Exercise
You have a base hue of 150° (green). Choose an accent hue using a complement, and name the two ramps' roles if the layout is 60/30/10. Then state what you would change if your accent text on a base-500 background fails the 4.5:1 contrast check.
Show answer
The complement is 150 + 180 = 330°, a magenta-pink. The neutrals (about 60%) use hue 150 at low saturation, the green ramp (about 30%) covers surfaces and headings, and the 330° accent (about 10%) is used for calls to action. If the contrast check fails, change the value of one color: darken the background or lighten the text. The hue stays the same, so the palette keeps its character.