Dark mode palette generator

Enter your light-theme colors, one per line. Each gets a dark counterpart with the same hue, plus its contrast ratio on the dark surface you choose.

Runs in your browser: nothing you enter is sent anywhere.

How to use it

  1. Enter your light-theme colors, one per line.
  2. Pick the dark surface the colors will sit on.
  3. Choose a minimum contrast, or None for backgrounds.
  4. Copy the result: each line shows light → dark · ratio.

How it works

  1. Convert the color to OKLCH (L, C, h).
  2. Mirror the lightness: L' = 100% − L. White becomes black, black becomes white and mid-tones stay near the middle.
  3. Keep the hue and scale chroma by 0.9.
  4. If a minimum contrast is set, raise L' in steps of 0.5 points until the WCAG ratio on the surface reaches it.

Example

On #121212, white mirrors to black (1.12:1 on the surface) and black mirrors to white (18.73:1). White with a 7:1 minimum becomes #a0a0a0 (7.16:1).

Tips

  • Treat the result as a first draft. Brand colors often need hand tuning.
  • Check pairs, not just single colors: use the contrast matrix on the dark palette.
  • Avoid pure white text on dark surfaces for long reading; a slightly dimmed white is easier on the eyes (rule of thumb).

Frequently asked questions

How is the dark color chosen?

The color is converted to OKLCH, its lightness is mirrored (L becomes 100% minus L), the hue is kept and chroma is cut to 90%, since saturated colors glare on dark backgrounds. Then it is converted back to HEX.

What does the minimum contrast do?

If the mirrored color has less contrast than you chose on the dark surface, it is made lighter in small steps until it reaches it. Use 4.5:1 for text and 3:1 for icons and borders. Choose None for background colors.

Should I use it for backgrounds too?

Mirroring works well for backgrounds and surfaces, such as a white page becoming near black. Set the minimum to None for those, or the tool will lighten them to reach text-level contrast.

Why #121212 and not pure black?

Very dark grey is a common choice for dark themes because it reduces harsh contrast with light text and lets shadows show. It is a convention, not a rule; pure black can suit OLED screens.

Is the result a finished theme?

No, it is a starting point. Review the colors on your real interface, and check text pairs with the contrast matrix.

More in Color

All tools in this category: Color ·Updated November 3, 2026

Privacy choices

Google Analytics shows us which tools are used and whether they work. It may set cookies. Your choice is kept in this browser.