How to Choose a Color Palette for a Website: Building a Full Palette From One Color
Updated: November 6, 2026 · AracMerkezi
▶ Open Color Palette Generator
A well-chosen color palette makes a site look professional and makes a brand memorable. Instead of using many colors, repeating a small number of colors consistently often gives better results. In this guide we build the method step by step from a single brand color, with numbers and CSS examples: choosing color is first a calculation and only then a matter of taste.
How many colors should a palette have?
A practical palette is divided into these roles:
- Primary color: The color that represents your brand, used on buttons and links.
- Secondary color: A supporting color that harmonizes with the primary.
- Neutrals: Gray tones for text, backgrounds and borders.
- Status colors: Success (green), warning (yellow), error (red).
For most sites, one primary, one accent, three or four neutrals and three status colors are enough; around twelve values in total can cover every screen.
The 60-30-10 rule
Balance is achieved when about 60% of the area is the dominant color (usually a neutral), 30% the secondary color and 10% the accent color. This is not a strict rule, just a practical starting guide. For example, on a landing page with 10 sections, 6 sections sit on a light neutral background, 3 on a dark primary background, and the accent appears only on buttons and a few icons.
Types of color harmony
- Complementary: Two colors opposite each other on the color wheel (180 degrees); gives vivid contrast.
- Analogous: Colors side by side (±30 degrees); looks calm and harmonious.
- Triadic: Three colors evenly spaced on the wheel (120 degrees); balanced and lively.
- Monochromatic: Light and dark shades of the same color; the safest option.
Example 1: Generating harmonies from a single HEX color
Let's pick #0B7A6B as the primary. Its HSL equivalent is roughly hue 172°, saturation 83%, lightness 26%. The harmony types are found by changing only the hue (the degree); if saturation and lightness stay the same, the colors look equally "heavy":
| Harmony | Hue | Result (S 83%, L 26%) |
|---|---|---|
| Primary | 172° | #0B796B (rounding difference from #0B7A6B) |
| Complementary | 172 + 180 = 352° | #790B1A |
| Analogous | 142° and 202° | #0B7934 and #0B5179 |
| Triadic | 292° and 52° | #6B0B79 and #796B0B |
Note: 172 + 120 = 292 and 172 + 240 = 412, so subtracting 360 gives 52; the hue wheel wraps between 0 and 360. Instead of doing this by hand, you can generate the values with the Color Palette Generator and copy the HEX codes.
Example 2: A tint scale from the same hue
Keeping hue and saturation and changing only lightness produces light backgrounds and dark heading colors. The contrast ratios of the values below against a white background have been calculated:
| Lightness | HEX | Contrast on white |
|---|---|---|
| 94% | #E3FCF9 | 1.07:1 |
| 45% | #14D2B9 | 1.92:1 |
| 34% | #0F9F8B | 3.31:1 |
| 26% | #0B796B | 5.30:1 |
| 16% | #074B42 | 10.03:1 |
For normal-size text, the WCAG AA level requires at least 4.5:1. According to the table, 34% lightness is still insufficient; only 26% and below is safe as a text or button background. A tone that looks nice can be unreadable; see the contrast guide for details.
Example 3: Neutrals and CSS variables
Pulling the primary's hue into the neutrals at very low saturation makes the palette feel unified. With the same 172° hue at 10% saturation you get a light background #F4F6F6, dark text #1C2221 and secondary text #5C706D. Contrasts: dark text on the light background is 14.89:1, secondary text 4.85:1 and a primary-colored link 4.83:1; all three clear the 4.5:1 threshold. For an accent, if we take the complementary hue in a more vivid form, #AD1F32 (hue 352°, S 70%, L 40%) gives 6.96:1 with white text.
Define these values once as CSS variables: --primary: #0B7A6B; --accent: #AD1F32; --bg: #F4F6F6; --text: #1C2221;. Then use them everywhere as color: var(--text) and background: var(--primary). If the color changes, you only update one line.
HEX, RGB and HSL
Colors can be written in different formats: #0B7A6B (HEX), rgb(11, 122, 107) (RGB), hsl(172, 83%, 26%) (HSL). HSL is the most useful for producing light and dark shades because it shows hue, saturation and lightness separately. You can convert between formats with the Color Code Converter; there is also a HEX-RGB guide.
Common mistakes
- Too many accent colors: If everything is highlighted, nothing stands out.
- Letting color alone carry meaning: Do not show an error state with red only; add an icon or text.
- Using pure black and pure white: Slightly tinted darks such as
#1C2221can reduce eye strain. - Shipping without measuring contrast: The screen in your design tool and a real device look different; always measure the ratio.
- Reusing the same colors in dark mode without adapting them: Dark backgrounds need lighter tones; recheck the contrast.
- Writing a different HEX on every page: Near-identical hand-typed shades (
#0B7A6B,#0B7B6C) create inconsistency instead of using a variable.
A palette for dark mode
In dark mode the same primary often does not work. #0B7A6B gives only 3.08:1 on the dark background #1C2221, below the 4.5:1 threshold. The same hue at 34% lightness, #0F9F8B, gives 4.89:1, and at 45% lightness, #14D2B9, gives 8.42:1. So in dark mode you need to shift the primary to a lighter tone for links and buttons, which is why defining variables separately per theme is a good habit.
When to break the rules
60-30-10 and harmony wheels are starting points. If a brand color already exists, you build the palette around it; on a photo-heavy site the color can come from the photographs. Cultural associations and accessibility (color blindness) must not be ignored.
Step by step
- Choose your brand's primary color and note its HSL value.
- Generate complementary, analogous or tint palettes with the Color Palette Generator.
- Test text and background pairs with the Color Contrast Checker.
- Define the colors as CSS variables and use the same variable everywhere.
- If you want a gradient background, see the CSS Gradient Generator.
Frequently asked questions
What is the 60-30-10 rule?
About 60% of the area is filled with the dominant color (usually neutral), 30% with the secondary and 10% with the accent. It is a starting guide for balance, not a strict rule.
How do I find a complementary color?
It is the color opposite on the wheel (180 degrees). In HSL, add 180 to the hue and subtract 360 if it exceeds 360; for 172° you get 352°.
What contrast ratio should a text color have?
The WCAG AA level asks for at least 4.5:1 for normal-size text. For example, #0B7A6B against white is about 5.2:1.
Tools mentioned in this guide
More guides
- How to Convert HEX to RGB Color Codes: Step-by-Step Examples – How to convert a HEX color code to RGB and back: hexadecimal basics, short and 8-digit HEX, darkening math and verified JavaScript and Python snippets.
- What Is Color Contrast Ratio? A Step-by-Step WCAG AA and AAA Calculation with Example Colors – How is color contrast ratio calculated? WCAG AA and AAA thresholds (4.5:1, 3:1, 7:1), the luminance formula, worked color examples and tips.
- How to Make Glassmorphism (Frosted Glass Effect) With CSS – How do you make a frosted glass effect with CSS? backdrop-filter, semi-transparent background, border and shadow values, plus support and contrast tips.
- Binary, Decimal and Hexadecimal Number Systems: Methods for Converting Between Bases – How do you convert between binary, octal, decimal and hexadecimal? The division and grouping methods, bit limits and worked examples.
- What Is the Difference Between PX, REM and EM? CSS Units, a Conversion Table and Which to Use When – What is the difference between px, rem and em in CSS, and which to use when? The px-to-rem formula, an em compounding example and a 16 px conversion table.
This article is for general information only and is not legal, financial or medical advice. We are not an official institution.