Guides

How to build a dark mode color palette

Updated 2026-09-14 · 3 min read · by the ColorSwoop team

Dark mode is not light mode inverted. It has its own rules, and most of them are about restraint. Each one below is shown on the surface it applies to.

1. Start from near-black, not black

Pure black creates harsh halos around text and leaves no room for elevation. Use a tinted near-black and build surfaces upward: each raised layer is 3–6% lighter.

Elevation as a lightness ladder — page, card, raised card, popover
Four surfaces, none of them black. The eye reads the steps as layers.
✕ Pure black, no steps
✓ Tinted near-black, stepped
Left: everything sits on #000000 and nothing can be raised above it. Right: the page, a card and a popover are three distinguishable layers.

Our dark palettes are filtered so every one includes at least one color below 35% lightness.

2. Text is off-white, not white

AaThe quick brown fox
#FFFFFF on #111111 18.88:1 · AAA Pure white: 19:1. More contrast than the eye wants for long reading; the text seems to vibrate.
AaThe quick brown fox
#E5E7EB on #111111 15.25:1 · AAA Off-white: still AAA, easier on the eyes.
AaThe quick brown fox
#A9A9B6 on #111111 8.13:1 · AAA Secondary text: a mid gray around 7:1.
AaThe quick brown fox
#6B6B78 on #111111 3.6:1 · AA large Too dim for a paragraph — placeholder or disabled only.
Same rules as light mode, 4.5:1 for body text — but the comfortable range is narrower at the top.

3. Desaturate accents

A brand blue that looks confident on white can glow on black. Lower saturation by 10–20% and lift lightness a little.

✕ Light-mode primary on dark
✓ Desaturated and lifted
The same brand purple. On the left it is the light-mode value #5B3DF5, glowing; on the right #8B77F8, the value this site actually uses in dark mode.

4. Use color for elevation, not shadows

Shadows disappear on dark backgrounds. Communicate layers with lightness steps (rule 1) and thin 1px borders at 10–15% white. Here is a dark palette poured into a page — the cards separate from the background by lightness alone:

BrandFeaturesPricingBlogGet started

Layers without shadows

Four colors, one page: background, text, a primary action and an accent — the roles a real interface needs.

Primary action Secondary
Card title
Card title
Card title
Tokyo Night: the classic editor-theme structure. Background, a lighter slate for surfaces, a periwinkle primary that is bright but not neon.

5. Test the palette in both modes

Every palette page on ColorSwoop has an Invert button in the UI preview that swaps background and text roles — the fastest way to see whether a scheme survives dark mode. The same palette, both ways:

BrandFeaturesPricingBlogGet started

Light mode

Four colors, one page: background, text, a primary action and an accent — the roles a real interface needs.

Primary action Secondary
Card title
Card title
Card title
Background #EEEEEE · text #222831 · primary #00ADB5 · accent #575D65 — open Midnight Coral
BrandFeaturesPricingBlogGet started

Dark mode, one click later

Four colors, one page: background, text, a primary action and an accent — the roles a real interface needs.

Primary action Secondary
Card title
Card title
Card title
Midnight Coral inverted. The teal accent holds up on charcoal because it was never fully saturated to begin with.

Ready-made starting points

Charcoal with a teal accent · the Tokyo Night structure · near-black with a neon lime for developer tools. The tech and cyberpunk collections have more neon-on-dark.

FAQ

Should dark mode use pure black?

Usually not. Pure #000000 makes text vibrate and hides elevation. Most design systems use a very dark gray or a tinted near-black such as #0F0F12 or #121826 and lighten surfaces by a few percent per level.

Why do brand colors look neon in dark mode?

Saturated colors on dark backgrounds appear brighter than on white. Reduce saturation 10-20% and raise lightness slightly for the dark-mode version of your primary color.

What contrast ratio does dark mode need?

The same as light mode: 4.5:1 for body text and 3:1 for large text and UI components. Light gray text on near-black (e.g. #E5E7EB on #111827) passes comfortably.