How to choose a color palette (for a website, brand or design)
Updated on · Reading time: 7 minutes · By Gabriel Maglia
Picking colors "by eye" is the fastest way to make a design look amateur.
A good palette isn't a list of pretty colors: it's a system
—a few colors with clear roles and their variants— that makes everything
you build look coherent. This guide shows how to define a palette that
works, how to derive it from an image you like, and how to get it ready for
your project.
The palette extracted from a photo, with the HEX values and the option to copy as HEX, CSS variables or JSON.
The most common mistake: too many colors with no role
Many people gather 8 or 10 colors they like and use them with no criteria. The result is noise. A professional palette is organized by roles, not by taste:
Primary: your brand color, the one that repeats most (buttons, links, accents).
Secondary / accent: one or two supporting colors to highlight specific things.
Neutral: a gray scale for backgrounds, borders and text. It's the most used, even if it doesn't seem so.
You don't have to invent from scratch. The best palettes usually derive
from a reference: a photo, a work of art, a product, a
landscape. If you already have an image whose combination you love, extract
its dominant colors with a palette
extractor: you upload the image and get the exact HEX. From there, you
assign roles.
Step by step
Choose a reference whose color combination you like.
Extract its dominant colors with their HEX.
Assign roles: primary, secondary, neutral and states.
Generate a scale for each color (light to dark).
Export to CSS variables or Tailwind to use it consistently.
The 50–900 scales: the design-system trick
One version of a color isn't enough. You need the light primary for a soft
background, medium for a button, dark for text on light. That's why design
systems (Material, Tailwind) use scales: from
50 (almost white) to 900 (almost black), keeping
the hue. With a scale per role you have every variant you'll need without
improvising. Color Studio can generate these scales —and the semantic
tokens— and copy them as CSS or Tailwind, ready to paste.
Quick harmony rules
60-30-10: ~60% of a dominant color (almost always the neutral), 30% of the secondary and 10% of the accent. Keeps everything from competing.
Contrast for text: text has to be readable. Aim for high contrast between text and background (check it with a contrast checker).
A single strong accent: if everything shouts, nothing stands out. Reserve the most saturated color for what matters.
Don't forget accessibility
A pretty palette that can't be understood is useless. Two quick checks:
enough contrast between text and background, and that
information doesn't depend on color alone (around 8% of men
have color blindness). You can
simulate how your design
looks with color blindness to be sure.
Frequently asked questions
How many colors should a palette have?
A primary, one or two secondary/accent colors, a neutral (grays) and state colors. With 3 to 5 base colors and their variants you can cover almost everything.
We tested it: from a photo to 6 HEX values, to CSS variables, and the eyedropper against known colors
I loaded the portrait with “Open photo” and went to “Color Studio” (6-color palette by default).
I moved “Number of colors” to 3, to 12 and back to 6; I pressed “Copy CSS variables” and “Copy JSON” and read the clipboard.
I loaded captura-ui-clara.png (1280 × 720 px, 41 KB), a screenshot I drew myself with known flat colors, and pinned the eyedropper with a click on four areas.
What I measured:
On entering Color Studio the 6-color palette appeared in 0.47 s. Changing to 3 colors took 170 ms and to 12, 183 ms.
“Copy CSS variables” left 8 lines in the clipboard (first: “:root {”). “Copy JSON” is valid JSON.
Eyedropper on known flat colors: 4 of 4 HEX values matched exactly (#F5F7FA → #f5f7fa; #2563EB → #2563eb; #DC2626 → #dc2626; #16A34A → #16a34a).
What went wrong or what limit I saw: The 3-color and 6-color palettes aren't a subset of each other (the first color of the 3 isn't among the 6): changing the number recalculates and can change colors. I only checked the eyedropper on flat colors; on a noisy photo it depends on the exact pixel where the click lands.
Tested by Gabriel Maglia on with PhotoCut (web) in Chrome 154.0.8037.98 · macOS 14.8.8 · PhotoCut version: commit bc142c7.