Your dark mode needs its own brand color.
Most apps get a dark mode the same way: swap the background to near-black, flip the text to white, and leave the brand color exactly where it was, because the brand color is the one thing nobody wants to touch. That last step is the mistake. A color picked to look right on white is usually the wrong color on black, and often it fails contrast outright.
The same hex, two different results
Contrast is a ratio between two colors, so changing the background changes every ratio on the screen. A mid-dark accent that reads well on white loses most of its contrast on a dark surface. Here are three real colors measured against white and against #121212, the dark surface Material Design recommends:
- Material’s old baseline purple, #6200EE: 7.6:1 on white, 2.5:1 on dark.
- A strong product blue, #1D4ED8: 6.7:1 on white, 2.8:1 on dark.
- A standard error red, #D32F2F: 5.0:1 on white, 3.8:1 on dark.
WCAG AA asks for 4.5:1 for body text and 3:1 for large text and interface parts like icons and input borders. All three colors pass on white. On dark, the purple and the blue fail even the 3:1 bar, so a link, an icon button or a focus ring drawn in them is close to invisible, and the red is too weak for an error message in body text. You don’t see this in a design file at 100% brightness on a good monitor. Your users see it at night with the screen dimmed.
The pattern runs the other way too. A mid teal, #0D9488, gets 3.7:1 on white and 5.0:1 on dark. A color that’s marginal in light mode can be fine in dark mode. The point isn’t that one mode is harder. It’s that you have two different sets of numbers, and you only checked one of them.
Why inverting the palette doesn’t work either
The tempting fix is mechanical: invert everything. Inverting #6200EE gives #9DFF11, an acid lime. Inversion flips hue along with lightness, so your purple brand becomes a different brand. Even if you invert lightness alone and keep the hue, three things still break.
Depth runs backwards. In light mode, raised things cast darker shadows. In dark mode, raised things are drawn lighter. Apple’s Human Interface Guidelines describe two sets of dark backgrounds, base and elevated, and a sheet or popover switches to the lighter elevated set automatically so it reads as closer. Material does the same with lighter surfaces at higher elevation. An inverted palette turns your shadows into glows and puts your cards in the wrong order. (We covered the shadow half of this in building a shadow that looks like real light.)
Saturation behaves differently on dark. A fully saturated color on a near-black field looks louder than the same color on white, and its edges can seem to shimmer against the background. That’s why both platform systems move the accent lighter and softer in dark mode instead of keeping it at full strength.
Images don’t invert. Photos, screenshots, illustrations and logos are fixed pixels. A logo with a transparent background and dark lettering disappears on a dark surface, and an illustration painted for a white page sits on black like a sticker. Those need their own variants or a plate behind them, which no color transform will give you.
What the platforms actually do
Neither Apple nor Google keeps the brand color fixed between modes. Their system colors are pairs.
Apple’s dynamic system colors resolve to a different value in each appearance: systemBlue is #007AFF in light mode and the slightly brighter #0A84FF in dark mode. The change is small, and that’s the lesson. The dark variant is the same color nudged up in lightness until it holds its contrast, not a new color.
Material Design’s dark theme guidance (from Material 2, and still the clearest written version) says to use a lighter, less saturated tone of the primary color. Its baseline uses the 200 tone instead of the 500, which turns #6200EE into #BB86FC. Against #121212 that moves the purple from 2.5:1 to 7.1:1 and keeps it recognisably the same brand. The baseline dark error color follows the same rule: #CF6679, a pinker, lighter red that gets 5.2:1 where the light-mode red got 3.8:1.
How to pick the dark-mode accent
You want the color a person would call the same as your light-mode accent, just lit differently. In practice:
- Keep the hue, raise the lightness. Work in a perceptual color space such as OKLCH rather than HSL, whose lightness slider doesn’t measure lightness. Hold the hue angle, step the lightness up, and stop when the accent clears 4.5:1 against your darkest surface and 3:1 against your most elevated one.
- Pull chroma down a little. Lighter colors at the same chroma often fall outside the sRGB gamut and get clipped, which shifts the hue. Reducing chroma keeps the color inside the gamut and stops it shouting on black.
- Flip the text that sits on it. A lighter accent usually needs dark text on top. A light teal like #2DD4BF gets 11.3:1 with black text and would be unreadable with white. Material names this role “on primary”, and in its dark baseline the on-primary color is black. Buttons are where this gets missed, because the light-mode button had white text and nobody re-checked it.
- Do the status colors too. Red, amber and green carry meaning, and a dim error state hides a real problem. Give each one a dark-mode value and check it the same way.
- Look at it dimmed. Turn the phone to its lowest comfortable brightness at night and use the app. Contrast ratios catch failures, but they don’t catch an accent that passes the numbers and still glares.
Name colors by role, not by value
The structural fix is in the code, not the palette. If a component asks for teal500, it gets the same teal in both modes, and somebody has to remember to override it every time. If it asks for accent, onAccent, surface, surfaceRaised and danger, each mode supplies its own value and the component never knows the difference.
Every platform supports this already: asset catalog colors with an “Any, Dark” appearance on iOS, values-night resources on Android, ThemeData and ColorScheme pairs in Flutter, and CSS custom properties switched by prefers-color-scheme on the web. If you find a raw hex inside a widget, that’s the place dark mode will break first.
A role list also makes the audit finite. Ten or twelve roles, each with two values, is a table you can check in an afternoon. A hundred hard-coded hex strings scattered through the code is not.
Where this shows up outside the app
Store pages make the same mistake. A screenshot set designed on white often gets reused as-is for a dark frame, and the accent headline that looked confident on white turns muddy on black. We hit the mirror image with our own first accent: an acid lime that measured 16:1 on our dark screens and 1.1:1 on our light cards, which we wrote up when we replaced it. One value checked against one background is the whole failure. For screenshot type on dark backgrounds, see setting white type on dark without the bloom.
Dark mode isn’t a filter you run over a finished design. It’s a second palette that shares hues and roles with the first, and it gets measured as carefully. Choosing the dark accent takes about an hour, and it’s much cheaper than finding out from a review that people can’t see your buttons at night.