Skip to content
Jellykit

Dark Mode Palette Generator

Turn a light color palette into a dark theme that keeps every color’s contrast with the page, and export both as CSS or JSON tokens.

  • Runs on your device
Loading tool

About Dark Mode Palette Generator

Paste the tokens of a light theme, one name: color pair a line, and get a matching dark theme beside it. Every color keeps its hue and its WCAG contrast ratio with the page: body text that was 15 : 1 on white stays 15 : 1 on the dark background, a border that was barely there stays barely there, and a 4.5 : 1 link still passes.

Choose the dark background and how much saturation to keep, then copy the result as CSS custom properties switched by the system setting or by a data-theme attribute, or as JSON design tokens.

How it works

  1. The page color is the token you name as the background, or the lightest color if you leave that empty. Every other token’s WCAG 2 contrast ratio with it is measured.
  2. In the dark theme, a color that was darker than the light page becomes lighter than the dark page, and the reverse, by the same ratio. The tool searches OKLCH lightness at the token’s own hue to find it.
  3. Chroma is scaled by the saturation you keep, then lowered further only where sRGB cannot hold it. Results are rounded to 8-bit hex, stepping outward if needed so that no ratio ends up below its light value.
  4. A ratio the dark background cannot reach, such as 21 : 1 on dark grey, is taken as far as the hue allows, and the tool lists those tokens.

Questions

Why not just invert the colors?

Inverting changes hues and gets contrast wrong, because perceived lightness is not symmetrical. Matching each ratio keeps text exactly as readable and keeps subtle surfaces subtle.

Which background should I choose?

A very dark grey, rather than pure black, keeps room for elevated surfaces and avoids harsh glare. The default #121417 is a common choice; any color darker than your light page works.

What format should the palette be in?

One token a line as name: color, using any CSS color notation. A leading -- and a trailing semicolon are fine, so a :root block of custom properties pastes as it is. Up to 60 tokens.

Will every dark color pass the same WCAG level as its light version?

Yes, unless the tool lists it as not reachable. A dark ratio is never below its light one; rounding to an 8-bit color can only raise it, by a few hundredths.

Everything you enter here is processed in this browser tab. Nothing is uploaded, logged or shared. How privacy works here.