PaletteGen
Theme

Choosing Your Dark Mode Colors

How to actually choose your dark-theme colors, not just how to switch to them.

By , PaletteGen

About 4 min read · Last reviewed

Short answer: Do not just invert your light theme. Keep the brand hue, lower saturation a little, check contrast in each theme on its own, and show raised surfaces with a lighter background instead of a shadow.

Choosing the colors, not just the toggle

This page covers how to choose the dark-theme colors themselves, not just how to switch to them. Here's a practical framework, using this site's own light and dark token set as a real, working example rather than a hypothetical. This covers semantic UI tokens specifically; if you're picking colors for chart categories instead, see choosing colors for UI and data visualization for the accessibility rules that apply there.

This site's own light and dark values
TokenLightDark
--bg#F4F4F2#121216
--surface#FFFFFF#1B1B21
--text#17171C#F2F1EF
--primary#B0125C#FF6FAE
1

Don't just invert lightness

Mechanically flipping a light theme's lightness values (swap white for black, keep everything else the same) tends to produce muddy, low-saturation dark themes: colors that read as vivid against white often go flat and grayish against black. The fix is to adjust lightness and slightly reduce saturation deliberately, rather than running a pure inversion.

2

Preserve brand hue

Your dark-theme accent should still read as the same brand color, not a different one. This site's accent shifts from a deep raspberry (#B0125C) in light mode to a brighter pink (#FF6FAE) in dark mode: same hue family, adjusted lightness for each background, not a hue swap.

Light: #B0125C
Dark: #FF6FAE
3

Check contrast in both themes independently

A text/background pairing that clears WCAG AA in light mode is not guaranteed to clear it in dark mode, and vice versa. They're two separate color pairs, not one pair with the lightness flipped. Check both with the contrast checker rather than assuming one pass covers both themes.

4

Surface elevation works backwards in dark mode

In a light theme, "higher" surfaces like cards and modals typically get subtle drop shadows to read as elevated above the page. In a dark theme, shadows barely show up against an already-dark background. Elevated surfaces usually read better with a slightly lighter background than the base, the opposite direction from the light-theme convention.

Light: shadow signals elevation
↔
Dark: lighter surface signals elevation

Put it into practice

Once you've worked out your light and dark values for each token using the framework above, build the actual light-dark() CSS pairs on the light-dark() generator. That page includes an "Auto-suggest dark value" button on every token row, implementing the exact framework above as working code. It isn't just prose here anymore, it computes a starting suggestion by checking whether your light value looks like a background, a text color, or an accent, then adjusts lightness and saturation accordingly rather than mechanically inverting. Treat its suggestion as a starting point, not a final answer. You can still override any value manually. If your token set is growing past a handful of names, Design Tokens Explained covers the primitive-vs-semantic naming structure that keeps it organized as it scales. The same lightness/saturation adjustment principle applies to gradient stops too, not just solid colors. See building dark-mode-aware gradients for the reliable way to carry a token pair into a gradient declaration.

Frequently Asked Questions

Should dark mode just be light mode with inverted colors?

No. A pure inversion tends to produce muddy, low-saturation results. Adjust lightness and saturation deliberately for each theme instead of mechanically flipping values.

How do I keep my brand color consistent across light and dark themes?

Stay within the same hue family and adjust lightness/saturation per theme, rather than switching to a different hue for dark mode.

Do I need separate contrast checks for light and dark mode?

Yes. A pairing passing WCAG in one theme doesn't guarantee it passes in the other, so check both independently.

What's "surface elevation" in a dark theme?

It's how a design signals that one surface (like a card or modal) sits "above" another. In light themes, shadows do this job; in dark themes, a slightly lighter background color usually reads better than a shadow.

Sources

  • WCAG contrast requirement applying independently to each theme: W3C Web Content Accessibility Guidelines 2.2
  • The lightness-inversion, hue-preservation, and surface-elevation principles aboveThis page's own synthesized practical framework, illustrated with this project's own token set as a worked example, not a claim of external authority.

About this page

The contrast rule comes from WCAG 2.2 and applies to each theme on its own. The lightness, hue and elevation advice is this site's own working framework, shown with this site's own tokens as the example, not an outside study.