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.
- Lowest surface — around #121212, the page background.
- Cards and panels — one step lighter, such as #1e1e1e. Separate layers by lightness instead of shadow.
- Floating elements — menus and modals in an even lighter tone such as #2a2a2a, so they feel raised.
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.