🌐 English

Home › Guides

Choosing colors for dark mode

Dark mode is not finished by simply inverting your light colors. On a dark surface the same color looks different, and glare and readability have to be rebalanced. Here is a practical order for choosing backgrounds, text and accents.

Why plain inversion fails

Turning a white background black and black text white gives you something that looks like dark mode. But accent colors glow much more on a dark surface, and shadows almost vanish against dark backgrounds, so depth disappears. Many people find a dark screen comfortable at night with low screen brightness, while in bright daytime settings light mode can be easier to read. Neither is always better, so it is best to offer both.

Treat dark mode as a separate palette rather than an inversion. You keep the same brand colors but re-pick lightness and saturation to suit a dark surface.

Dark gray instead of pure black

A #000000 background gives white text the maximum contrast of 21:1, yet some people find it harsher to read for long periods because of glare or smearing on certain screens. Many design systems use a very dark gray such as #121212, or a dark tone with a slight blue cast.

Text color and contrast targets

Many designers also prefer a slightly softened white such as #e6e6e6 over pure #ffffff for long reading. Do not rely on taste, though; verify with numbers. WCAG asks for 4.5:1 for normal text and 3:1 for large text (roughly 24px and up, or bold 19px and up) and for UI components such as icons.

Secondary and disabled text must meet these targets too. Gray text that is a little too dark on a dark background easily falls below 4.5:1, so enter the background and text HEX values into the contrast checker and confirm they pass.

Accents: lighter and less saturated

A strong accent that worked in light mode tends to tire the eyes and lose contrast when carried over unchanged to a dark surface.

A workflow that stays consistent

Start in the palette generator and build a 50 to 950 scale for your brand color. Use the low numbers for backgrounds in light mode, and the high numbers (900 to 950) for backgrounds in dark mode, with the opposite end of the scale used for text. Both modes then come from one palette and stay consistent.

Finally, test on real devices. Check that everything is readable in a bright room and a dark room, at both minimum and maximum screen brightness, and run every text and background pair through the contrast checker one last time.

Common mistakes

A handful of mistakes come up again and again when people build dark mode. Use this list as a self-check; even one pass raises the polish noticeably. Rather than aiming for perfection at once, convert three or four key screens first, find the problems, then extend to the rest. Let users switch easily in settings, and also consider defaulting to the device setting.