Dark Mode Converter

Paste a light-theme palette and get a suggested dark-mode equivalent for every colour. A starting point to refine, with contrast shown against the dark background.

One colour per line, as name: colour or just a colour. HEX, rgb(), hsl() and CSS names all work (up to 20). The first colour is treated as the page background when contrast is shown.

Light and dark side by side

  • --backgroundpage background
    Light#FFFFFF
    Dark#141414
  • --surface1.08:1 on dark background · Low contrast
    Light#F4F4F5
    Dark#1C1C1F
  • --text13.59:1 on dark background · AAA
    Light#18181B
    Dark#DDDDE0
  • --primary3.14:1 on dark background · AA large / UI
    Light#2563EB
    Dark#255CD6
  • --accent8.02:1 on dark background · AAA
    Light#F59E0B
    Dark#E49D24
  • --danger3.73:1 on dark background · AA large / UI
    Light#DC2626
    Dark#CF3737

Export

:root {
  --background: #FFFFFF;
  --surface: #F4F4F5;
  --text: #18181B;
  --primary: #2563EB;
  --accent: #F59E0B;
  --danger: #DC2626;
}

.dark {
  --background: #141414;
  --surface: #1C1C1F;
  --text: #DDDDE0;
  --primary: #255CD6;
  --accent: #E49D24;
  --danger: #CF3737;
}

How the conversion works

Each colour is converted to HSL. Its lightness is inverted (a lightness of 100 becomes 0), then mapped into a comfortable range of 8–96 so white becomes a near-black surface and black becomes an off-white text colour rather than pure #000 or #FFF. Saturation is scaled down to the percentage you choose, because vivid colours tend to vibrate against dark surfaces. The hue never changes.

Treat it as a starting point

Inversion is a quick, predictable first draft, not a finished theme. A mid-tone brand colour stays mid-tone, so check the contrast figures shown for each colour against your dark background, and fine tune any that fall short, for example with the Contrast Checker.

Related tools