vasilenko.info

Color scale generator from 50 to 950

/en/tool/color-scale/ works Runs in the browser

Enter a color, and the tool will build a scale from it and show how it behaves in an interface: the contrast of every step against every other, a live card in light and dark themes, and a color-blind view. Add as many scales to a set as you need—primary, neutral, success, warning, and danger can all be exported in one file. Export formats: CSS, Tailwind v3 and v4, SCSS, JSON, W3C tokens, Android, and SwiftUI. Nothing is sent to the server.

promoTwenty years of notes on websitesHow we did it in 2008 and what still works today.Open

Color set

Hue and saturation come from the base color; lightness comes from the curve. You can have multiple scales—they will be exported to a single file.

HEX, rgb(), hsl(), oklch(), or a color name Could not parse the color. Example: #3366CC
Only Latin letters, numbers, and hyphens will remain. The name must start with a letter; otherwise, brand will be used.

Other scales in the set

“Build set” adds neutral, success, warning, and danger with the same curve settings and their own base colors. The neutral scale uses the brand hue with nearly zero saturation: a tinted gray, not a dead gray.
Pin base color to step
With “Auto”, steps use their own lightness values, and the tool shows which one the color matches. Pin it to make the selected step exactly the HEX value from the design: the curve will stretch toward it while preserving its shape and ends.
Steps in scale
Lightness curve
The curve determines where the scale is denser: the middle stretches in Tailwind, spacing is more even in Material, almost the entire scale is light in Radix, and there is just one dark end.
0% — the ends use as much saturation as fits
The saturation limit is calculated for P3 rather than sRGB. Colors are output as oklch() for wide-gamut displays. The HEX value remains as a fallback, clipped to sRGB.
Values in table and CSS

Scales

Color blindness view

Base color step

Base color
OKLCH
Lightness L
Saturation C

Calculated by the browser. Colors are not sent anywhere: you can verify this in DevTools—there are no more requests after the page loads.

How it looks in the interface

The card is built from the steps of the first scale: heading, text, link, button, and badge. Below it, you can see which step went where and with what contrast — that is the answer to “does it work?”

Preview theme

Step-to-step contrast

The row shows the text color, and the column shows the background color. Each number is calculated for exactly that pair: if you can’t make anything out in a cell, that pair doesn’t work. White and black are added at both ends because they are the colors most often used in pairs.

What to measure

Steps individually

Each step is broken down into numbers: its value, contrast with black, and contrast with white. The dot marks the step where the base color landed.

Add to project

Eight formats using the same numbers. The file contains the complete set of scales, not just the first one.

Export format
styles.css Scale variables
promoCalculate ROI at the same timeCampaign payback based on spend and revenue.Open

How to use it

  1. Paste a color you already use: a button, link, or logo. The step bars in the panel redraw with every character you type.

  2. If this HEX must remain unchanged in the interface, pin it to a step—500, 600, or whichever one fits. The curve will stretch toward it while the ends of the scale stay at their original lightness values.

  3. Click “Build set” when you are creating a design system: neutral, success, warning, and danger will be added. All scales use the same curve settings, so their steps match by lightness and can be swapped.

  4. Check the contrast grid. A pair whose number cannot be read will not be readable in the interface either. This is not a metaphor: the number is written in those exact colors.

  5. Check the card in dark mode and switch the vision simulation to deuteranopia. These are two places where scales usually fall apart.

  6. Choose a format and download the file. CSS, Tailwind v3 and v4, SCSS, JSON, W3C tokens, colors.xml for Android, and SwiftUI—the complete set of scales in one file.

  7. The palette link stores all settings in the page address. You can send it to someone or bookmark it, and the entire palette will be restored.

promoBrowser task listNo account required—everything is stored on your device.Open

The formula and what it includes

Step = OKLCH(curve lightness, base saturation × compression, base hue + edge shift)

Lightness comes from OKLCH rather than HSL, which is why the steps look even. In HSL, 50% lightness means different visible brightness for yellow and blue, so an eleven-step scale dips in the middle. Color-blindness simulation uses the Viénot–Brettel matrices in linear RGB. It is an approximation, not a medical device, but pairs that it merges into one color will merge in practice as well.

Example breakdown: #3366CC pinned to 500

The input data is the same as the default field values: you can calculate it mentally and confirm that the tool is telling the truth.

  1. The OKLCH lightness of #3366CC is 53.25%. With “Auto,” this color lands on step 700: its curve value is 52%, and nothing is closer.

  2. We pin it to 500. The five-hundredth step was set to 68% in the curve; it is now assigned 53.25%, the base color’s lightness.

  3. Steps lighter than 500 stretch between the fixed edge at 97% and the new 53.25%: 400 moves from 75% to 63.81%, and 200 from 88% to 83.42%.

  4. Darker steps compress between 53.25% and the fixed edge at 26%: 600 moves from 60% to 48.06%, and 800 from 44% to 37.68%.

  5. The hue of 262.29° and saturation of 0.1679 at 500 remain unchanged, so it is reconstructed from OKLCH(53.25%, 0.1679, 262.29°) and again produces exactly #3366CC.

The scale is darker than before, but the brand color remains the same HEX and takes the 500 position. The contrast of #3366CC with white is 5.36, above the 4.5 threshold, so this step works for body text on a light background.

Frequently asked questions

promoAll toolsForty-four tools, all running in your browser.Open

Related tools

5

WCAG contrast checker

Calculates the contrast of a color pair and shows whether it passes AA and AAA.

Open