Color Palette Generator

Build harmonious palettes from a base color and export them as CSS.

  • Runs in your browser
  • Free, no sign-up
5

Click a color to copy its hex code.

Export

Palette from an image

Drop a photo here or click to choose one The image stays on your device.

About the Color Palette Generator

The Color Palette Generator turns one base color into a set of colors that work together. Pick a harmony, such as analogous, complementary or triadic, choose how many colors you want, and copy the result as CSS variables, SCSS, a Tailwind theme, JSON or a plain list of hex codes.

It is useful when you start a website, an app screen, a slide deck or a brand board and have one color to build on. The "Shades (50 to 900)" option creates a full ten-step scale in the style of Tailwind and Material, ready to drop into a design system.

You can also drop in a photo and get its main colors, sorted by how much of the picture they cover. Colors are calculated in OKLCH, a color space that matches how people see lightness, so the steps look even. Everything runs in your browser and images never leave your device.

How to use it

  1. Pick a base colorUse the color box or type any CSS color, such as #2b59ff or rgb(22, 160, 133). Random base picks one for you.
  2. Choose a harmonyAnalogous, monochromatic, complementary, split complementary, triadic, tetradic, square, or shades from 50 to 900.
  3. Set the number of colorsMove the Colors slider from 3 to 10. Shades always give ten steps.
  4. Copy what you needClick a swatch to copy its hex code, or pick an export format and use Copy or Download.
  5. Or start from a photoDrop an image into "Palette from an image" to pull out its main colors. The Colors slider then sets how many to find.

Key features

Eight harmonies

Classic color wheel schemes plus a monochromatic range and a ten-step shade scale, all based on your color.

Perceptual color math

Hues are rotated in OKLCH and keep the base color's lightness, so a palette does not suddenly jump between pale and dark colors.

Always valid colors

When a hue cannot be shown on screen at that colorfulness, the tool lowers the chroma instead of clipping, so the hue and lightness stay right.

Five export formats

CSS custom properties, SCSS variables, a Tailwind v4 @theme block, JSON and a hex list, each with a matching file name for download.

Colors from a photo

Finds the main colors of an image with k-means clustering in OKLab, skips transparent pixels and lists the largest areas first.

Private by design

Photos you drop in are analyzed on your device. There is no upload, no account and no stored copy.

Examples

One base color, different harmonies

With the default base #2B59FF and 5 colors:

HarmonyPalette
Analogous#007E97 #0078B5 #2B59FF #773EF4 #A222D3
Complementary#2B59FF #8E6B00 #6A95FF #C19300 #1020CD
Triadic#2B59FF #D4001E #008928 #6A95FF #FF5A54
Mono­chromatic#D9E5FF #8CAFFF #4272FF #1839CC #060085

Analogous colors sit 24 degrees apart on the color wheel, with the base in the middle. Complementary and triadic palettes start with the base and the colors opposite it. Once every hue is used, the tool repeats them lighter and then darker, which is where #6A95FF (a lighter base) and #1020CD (a darker base) come from.

Exporting a palette

The triadic palette above as CSS custom properties:

:root {
  --color-1: #2b59ff;
  --color-2: #d4001e;
  --color-3: #008928;
  --color-4: #6a95ff;
  --color-5: #ff5a54;
}

SCSS gives $color-1: #2b59ff; and so on, JSON gives {"1": "#2b59ff", …}, and the hex list has one code per line.

A shade scale for a design system

Choose "Shades (50 to 900)" and the Tailwind export gives:

@theme {
  --color-brand-50: #f1f5ff;
  --color-brand-100: #dde8ff;
  --color-brand-200: #bcd1ff;
  --color-brand-300: #91b2ff;
  --color-brand-400: #6792ff;
  --color-brand-500: #4272ff;
  --color-brand-600: #2954eb;
  --color-brand-700: #1a3cc7;
  --color-brand-800: #0d24a4;
  --color-brand-900: #060482;
}

In Tailwind v4 this gives you classes like bg-brand-50 and text-brand-700. The scale keeps the hue of your base color, but the 500 step is not your exact base. Each step has a fixed lightness so different brand colors produce scales that line up.

Colors from a picture

An image that is half #2B59FF, 30% #C6F24E and 20% #FF6A4D gives exactly those three colors, in that order. Ask for 10 colors and you still get three, because the picture has no more. With a real photo, each swatch is the average of a group of similar pixels.

Tips

  • Start with analogous colors for calm, low-risk designs, and save complementary or triadic palettes for accents such as buttons, badges and charts.
  • Use the colors of a palette in different amounts. A common split is 60% for a neutral background, 30% for the main color and 10% for an accent.
  • Check text on every palette color with the Color Picker's contrast check. Harmonies keep the base lightness, so some colors may be too light for text on white.
  • For a design system, generate the 50 to 900 shades once for each brand color and keep the export in your repository, so everyone uses the same values.
  • When pulling colors from a photo, crop it to the part you like first. Large areas of sky or background otherwise take over the palette.

Common mistakes and limits

  • Expecting the exact base color in every paletteAnalogous and the wheel-based harmonies include your base. Monochromatic and shades rebuild the color at fixed lightness steps, so your exact code may not appear.
  • Using every color at full strengthFive saturated colors side by side compete for attention. Pick one main color and use the rest as accents or light tints.
  • Judging a palette on one screenColors look different on other displays and in dark mode. Check on a phone and a second monitor before you commit.
  • Expecting the same photo palette every timeThe clustering starts from random points, so a busy photo can give slightly different colors on each run. Flat graphics with clear areas give the same result.
  • Trusting color alone to carry meaningRed and green look alike to many people with color vision deficiency. Pair colors with icons, labels or patterns.

Frequently asked questions

What is a color harmony?
A rule for choosing colors by their position on the color wheel. Analogous colors are neighbors, complementary colors are opposite, and triadic colors are evenly spaced at 120 degrees.
What is the difference between tetradic and square?
Both use four hues. Square spaces them evenly at 90 degrees. Tetradic uses two complementary pairs 60 degrees apart (0, 60, 180 and 240 degrees), a rectangle on the wheel.
Why are the colors calculated in OKLCH?
In older models like HSL, yellow looks much lighter than blue at the same lightness value. OKLCH matches what people see, so colors with the same lightness really look equally light.
How many colors can I get?
From 3 to 10 with the Colors slider. Shades always produce ten steps, named 50, 100, 200 and so on up to 900.
How does "Palette from an image" work?
The image is reduced to at most 72 pixels on its longest side, transparent pixels are skipped, and similar colors are grouped with k-means clustering. Each group's average color becomes a swatch, largest group first.
Which export should I use?
CSS for plain stylesheets, SCSS for Sass projects, Tailwind for a Tailwind v4 theme, JSON for design tokens or scripts, and the hex list for design apps that accept pasted codes.
Can I use these colors commercially?
Yes. Colors are not owned by anyone, and the palettes are generated on your device for you to use however you like.
Is my photo uploaded?
No. The image is read and analyzed in your browser. Nothing is sent or saved.