·7 min read

How to Design the Perfect Dark Mode Color Palette

dark modeUI designaccessibility

Why Dark Mode Matters

Dark mode is no longer a nice-to-have — it's expected. Studies show that over 80% of users prefer dark mode in at least some apps. It reduces eye strain in low light, saves battery on OLED screens, and can look incredibly polished when done right.

But designing a good dark mode palette is harder than "just invert the colors." This guide covers the principles, techniques, and exact color values you need.

The Foundation: Surface Colors

The biggest mistake in dark mode design is using pure black (`#000000`) as the background. Pure black creates harsh contrast with text and makes content feel like it's floating in a void.

Instead, use dark gray surfaces with subtle color tinting:

```css

/* Recommended dark surface hierarchy */

--surface-lowest: #0c0e12; /* Deepest background */

--surface: #111317; /* Main background */

--surface-container: #1a1c20; /* Cards, panels */

--surface-container-high: #1e2024; /* Elevated elements */

--surface-highest: #282a2e; /* Tooltips, dropdowns */

```

Notice these aren't pure grays — they have a slight blue-purple tint that adds depth and warmth. This is a technique used by Apple, Google, and most modern dark-mode interfaces.

The Surface Elevation Principle

In dark mode, lighter = higher elevation. This is the opposite of light mode where shadows create depth. Each surface level gets slightly lighter:

LevelUse CaseSuggested Value
LowestPage background`#0c0e12`
DefaultMain content area`#111317`
ContainerCards, sidebars`#1a1c20`
Container HighModals, popovers`#1e2024`
HighestTooltips, menus`#282a2e`

Extract surface colors from dark-themed apps and images you admire using PaletteAI's color extractor.

Text Colors: Getting Contrast Right

Pure white text (`#FFFFFF`) on dark backgrounds is also too harsh. Use slightly dimmed white tones:

```css

--text-primary: #e2e2e8; /* Main text — high contrast */

--text-secondary: #c7c4d7; /* Secondary info — medium */

--text-tertiary: #8e8c9d; /* Muted labels — low */

--text-disabled: #5a586a; /* Disabled states */

```

Contrast Ratios Matter

WCAG 2.1 requirements still apply in dark mode:

Text TypeMinimum RatioCheck
Body text4.5:1`#e2e2e8` on `#111317` = 13.2:1 ✓
Large text3:1`#c7c4d7` on `#111317` = 9.7:1 ✓
UI components3:1`#8e8c9d` on `#111317` = 5.1:1 ✓
DisabledNo requirement`#5a586a` intentionally low contrast

Accent Colors: Desaturate for Dark Mode

Bright, saturated accent colors that look great on light backgrounds become eye-straining on dark ones. The solution: reduce saturation by 10-20% and increase lightness slightly.

ColorLight ModeDark Mode
Purple`#9333EA``#A855F7`
Blue`#2563EB``#3B82F6`
Green`#16A34A``#22C55E`
Red`#DC2626``#EF4444`
Orange`#EA580C``#F59E0B`

The dark mode versions are lighter and slightly less saturated — easier on the eyes while maintaining clear visual hierarchy.

Browse pre-built dark mode palettes in our dark theme collection.

Borders and Dividers

Borders in dark mode should be subtle, not invisible. Use semi-transparent white or colored outlines:

```css

--border-default: #464554; /* Visible border */

--border-subtle: rgba(255,255,255,0.1); /* Very subtle */

--border-strong: rgba(255,255,255,0.2); /* Emphasized */

```

A common technique is using your accent color at low opacity for interactive element borders:

```css

.card:hover {

border-color: rgba(168, 85, 247, 0.3); /* Purple glow effect */

}

```

Shadows in Dark Mode

Traditional box shadows are nearly invisible on dark backgrounds. Instead of shadows, use:

1. Surface elevation (lighter backgrounds for higher elements)

2. Subtle borders to separate layers

3. Glow effects with colored shadows for emphasis:

```css

.elevated-card {

background: #1a1c20;

border: 1px solid rgba(255,255,255,0.08);

/* Optional subtle glow */

box-shadow: 0 0 20px rgba(168, 85, 247, 0.05);

}

```

Building a Complete Dark Palette: Step by Step

Step 1: Choose Your Surface Tint

Pick a subtle hue for your grays. Blue-gray feels techy and modern. Warm gray feels cozy and approachable. Purple-gray feels creative and premium.

Step 2: Create 5 Surface Levels

Start from your base (`#111317`) and create 2 darker and 2 lighter levels, each separated by ~4-8 lightness points in HSL.

Step 3: Set Text Hierarchy

4 text levels from high-emphasis primary to disabled. Ensure all meet WCAG contrast requirements.

Step 4: Adjust Accent Colors

Take your light-mode brand colors and increase lightness by 10-15%, reduce saturation by 5-10%.

Step 5: Define Interactive States

Each interactive element needs: default, hover, active, focus, and disabled states.

```css

/* Button states example */

--button-bg: #A855F7;

--button-bg-hover: #9333EA;

--button-bg-active: #7E22CE;

--button-bg-disabled: #3B0764;

--button-text: #FFFFFF;

--button-text-disabled: #6B21A8;

```

Common Dark Mode Mistakes

1. Pure Black Backgrounds

As mentioned — use tinted dark grays instead. `#111317` > `#000000`.

2. Inverted Light Mode

Don't just flip black and white. Dark mode needs its own color logic — lighter surfaces = higher elevation.

3. Saturated Colors on Dark

High-saturation colors vibrate against dark backgrounds. Always desaturate.

4. Inconsistent Elevation

If some cards use borders and others use background differences, the hierarchy gets confusing. Pick a system and stick with it.

5. Forgetting Images

Photos and illustrations designed for light mode can look jarring on dark backgrounds. Consider adding a subtle dark overlay or reducing image brightness:

```css

.dark-mode img {

filter: brightness(0.85);

}

```

6. Ignoring Focus States

Focus rings need to be visible on dark backgrounds. Use a bright outline with offset:

```css

:focus-visible {

outline: 2px solid #A855F7;

outline-offset: 2px;

}

```

Extracting Dark Palettes from Inspiration

See a dark-mode design you love? Screenshot it and upload to PaletteAI. The color extractor will identify the exact surface colors, text tones, and accent colors used.

This works for:

  • Screenshots of apps (Figma, Notion, Discord, Spotify)
  • Dark-themed websites
  • Movie and game UI references
  • Dark photography for surface tint inspiration

Frequently Asked Questions

Should I offer both light and dark mode?

Yes, if possible. Users have strong preferences. Use `prefers-color-scheme` media query to auto-detect, and provide a manual toggle.

What's the best background color for dark mode?

Not pure black. We recommend `#111317` (slight blue tint) or `#18181B` (Tailwind's zinc-900). These reduce eye strain and create depth.

How do I test my dark mode palette for accessibility?

Use browser DevTools to check contrast ratios. Every text/background combination should meet WCAG 2.1 AA (4.5:1 for body text, 3:1 for large text and UI components).

Can PaletteAI extract dark mode colors from screenshots?

Yes. Upload any screenshot to PaletteAI and it will extract the dominant dark colors including backgrounds, surfaces, and accents.

Should status colors (success, error, warning) change in dark mode?

Yes. Lighten them by 10-15% and reduce saturation slightly. The exact values we recommend: success `#22C55E`, error `#EF4444`, warning `#F59E0B`.

Design Your Dark Palette Now

Upload any dark-themed screenshot or image to PaletteAI and extract the exact colors. Free, browser-based, no signup required.

Open PaletteAI Color Extractor →

Ready to Try PaletteAI?

Extract colors from any image — free, instant, private.

Try PaletteAI Free

More Articles