Colour Palette Generator · Tutorial
How to build a brand colour scale for your website
8 min readbeginnerUpdated
You have one brand green and need a complete set of colours for backgrounds, borders, buttons and text. This tutorial generates a 50–950 scale and analogous accents from it, exports them as code, and shows which step to use where.
What you need
- The Colour Palette Generator
- Your brand colour, or the sample from the Try it button
Steps
Enter the brand colour
Type the colour code into Base colour. The sample is
#0f9d76, a fresh green. Name the paletteleaf; the exported variables will use that name.Choose accent colours
Pick Analogous in Harmony for calm neighbouring hues, a teal and a lime-green here. For a contrasting call-to-action colour, try Complementary instead.
Read the shade scale
The scale runs from 50, almost white with a hint of green, to 950, nearly black. The middle steps stay closest to your brand colour. Each swatch shows readable text, black on light steps and white on dark ones.
Give each step a job
A simple, reliable mapping: 50–100 for page and card backgrounds, 200–300 for borders and dividers, 500–600 for buttons and links, 700 for hover and pressed states, and 800–950 for headings and body text.
body { background: var(--leaf-50); color: var(--leaf-950); } .card { border: 1px solid var(--leaf-200); } .button { background: var(--leaf-600); color: white; } .button:hover { background: var(--leaf-700); }Export the code
Choose CSS variables and press Copy, then paste the
:rootblock at the top of your stylesheet. For Tailwind CSS v4, choose the Tailwind format and paste it into your main CSS file to get classes likebg-leaf-600.Check contrast
Before using a step for text, test it on its background in the Colour Contrast Checker. White text on the 600 step usually passes; on 400 it often doesn’t.
Try it yourself
Opens the Colour Palette Generator with this tutorial's sample loaded.
Common mistakes
- Using the middle step for body text
- Middle steps are too light for long text on white. Use 800 or darker.
- Too many accent colours
- Pick one accent and use it sparingly. Many accents compete for attention.
- Expecting the exact base colour in the scale
- Scale steps have fixed lightness levels. If you need the exact brand colour as a token, add it separately, for example
--leaf-brand: #0f9d76;.
Next steps
Go back to the Colour Palette Generator, or keep going with one of these:
FAQ
Can I make a scale for each accent too?
Yes. Click an accent swatch to copy its code, paste it as the base colour, and export again with a new name.
Will the palette work in dark mode?
The same scale works in reverse: dark steps for backgrounds, light steps for text. Check contrast for each pairing.