Lab

Lab 04

Color palette generator from an image or a descriptionDescribe a brand.Get a color system.

Start from an image, or let the model read your description and choose a recipe: a primary hue, an accent, how saturated, how tinted the greys. The browser does the maths in OKLCH, checks every text and surface pair against WCAG, and hands you tokens for CSS and Tailwind.

Describe the brand, or use an image. Nothing is stored, and images never leave your device.

A color palette generator from an image or a description

This color palette generator turns an image or a short brand description into a full color system, not just five swatches. From an image, your browser reads its main colors; from a description, a model picks the recipe. Either way, and your browser builds the scales in OKLCH, checks every key text and surface pair against WCAG, and gives you tokens for CSS and Tailwind.

  1. 01

    Start from an image or words

    Press From an image (or drop one on the box) to build from a photo, logo or screenshot, or write a sentence or two about the brand. The image is read in your browser and never uploaded, and nothing you type is stored.

  2. 02

    Tune the recipe

    Press Generate. Then adjust the primary hue, accent hue, saturation (muted, balanced or vivid) and grey tint. Variation shifts the accent, and Lock primary keeps your main hue while you try others.

  3. 03

    Check and export

    Preview the palette in light and dark mode, read the contrast table, then copy the CSS variables or the Tailwind v4 @theme block, or download a .css file. Click any swatch to copy its hex value.

What you get

Three scales, primary, accent and neutral, each with eleven steps from 50 to 950. Four semantic colors: success, warning, danger and info. And role tokens for light and dark mode: background, surface, text, muted text, border, primary, accent, and the label colors that sit on primary and accent.

The CSS export puts the light roles on :root and the dark roles inside a prefers-color-scheme: dark media query, so dark mode works with no extra code.

Why OKLCH and real contrast checks

OKLCH keeps the same perceived lightness across hues, so a 500 blue and a 500 orange feel equally strong. Chroma is reduced only where a screen cannot show the color.

The contrast table checks the pairs your interface will actually use, such as body text on the background, muted text, button labels and links, and grades each one as AAA, AA, AA large or Fail under WCAG 2. Button colors are picked from the first step whose label reaches 4.5:1.

How to use the palette in a real project

Use the role tokens in your components, not the raw scale steps. Write background: var(--bg) and color: var(--text) instead of a fixed neutral step, so dark mode and later brand changes happen in one place.

Keep the accent rare. It works best for one job, such as a highlight, a badge or a single call to action. If every button uses it, it stops drawing the eye. Run the contrast table again whenever you change a hue by hand, because a small hue shift can move a pair from AA to Fail.

Frequently asked questions

Can I make a color palette from an image?

Yes. Press From an image or drop a photo, logo or screenshot on the box. Your browser finds the main colors, picks the strongest common one as the primary and a different hue as the accent, then builds the full system. The image is never uploaded.

What does WCAG AA mean for colors?

WCAG 2 AA asks for a contrast ratio of at least 4.5:1 for normal body text and 3:1 for large text. AAA asks for 7:1. The generator grades each text and background pair against these ratios, so you can see which pairs are safe before you ship.

Can I use the palette with Tailwind CSS?

Yes. Switch the token panel to Tailwind v4 theme and copy the @theme block into your main CSS file. It defines --color-primary-50 to --color-primary-950 and the same for accent and neutral, plus success, warning, danger and info, so classes like bg-primary-600 work right away.

What happens if the AI model is not available?

The tool falls back to a local recipe built from your description, and it tells you so. The scales, contrast checks and tokens are calculated in your browser either way, so you still get a complete, tested palette. You can then tune the hues and saturation by hand.

Is the color palette generator free for commercial use?

Yes. The palette is yours to use in any project, personal or commercial, with no account and no credit required. The values are plain hex codes in CSS variables, so they work in any stack, design tool or framework.

Need this built into your site?

I build tools like this one, and the sites around them. Tell me what you need and I will reply with a plan and a fixed price.