Color Palette Generator

Pick a base color and a harmony rule, lock the swatches you like, and copy the hex codes or CSS variables.

Choose a base color and rule

    CSS variables

    
        

    How to use the color palette generator

    1. Set the Base color with the swatch or by typing a hex code such as #2563eb. Three-digit codes like #f80 work too.
    2. Choose a Harmony rule. The five swatches update at once.
    3. Press New palette (or the Space bar) to try a random base color. The Random rule ignores the base and draws five unrelated colors.
    4. Press Lock on a swatch to keep it. Locked colors stay put when you change the base, the rule or press New palette.
    5. Read the contrast line on each swatch to see whether white or black text is easier to read on it.
    6. Use Copy for one hex code, or Copy hex codes or Copy CSS variables for all five.

    How the harmonies are built

    Each rule turns your base color into hue, saturation and lightness (HSL) and rotates the hue around the color wheel, as described in color scheme theory. Your base color is always one of the five swatches.

    Contrast uses the WCAG contrast ratio, (L1 + 0.05) / (L2 + 0.05), from each color's relative luminance, rounded down to two decimals. WCAG level AA asks for at least 4.5 to 1 for normal text and 3 to 1 for large text.

    Worked example with the default inputs

    The page loads with Base color #2563eb (HSL 221, 83%, 53%) and the Analogous rule. The CSS box shows exactly this:

    :root {
      --color-1: #25ebad;
      --color-2: #25c6eb;
      --color-3: #2563eb;
      --color-4: #4a25eb;
      --color-5: #ad25eb;
    }

    Swatch 3 is the base color, where white text scores 5.16:1 (AA). Swatch 1, #25ebad, scores 13.56:1 with black text (AAA).

    Limits and edge cases

    Frequently asked questions

    How many colors should a brand palette have?

    Three to five core colors is enough for most digital work. Add a near-white and a near-black for backgrounds and text, plus a green and a red for success and error messages.

    What is the difference between analogous, complementary and triadic palettes?

    Analogous colors sit next to each other on the color wheel and feel calm. Complementary colors sit opposite and give the strongest contrast. Triadic colors are spaced 120 degrees apart and feel lively but balanced.

    How do I choose a text color that is readable on my palette?

    Aim for a contrast ratio of at least 4.5 to 1 for normal text and 3 to 1 for large text. The line under each swatch tells you whether white or black text scores higher on that color.

    Can I use these palettes commercially?

    Yes. The colors are ordinary hex codes calculated from your input, and you do not need to credit this site. A well-known brand color can be protected as a trademark, so avoid copying a competitor's signature color.

    Convert a swatch to RGB, HSL or CMYK with the color picker, fade two of the colors together with the CSS gradient generator, or draw unrelated colors with the random color generator.