Color · Made a little simpler

Dark Mode Color Adapter

Adapt named colors using Perceptual, Invert or Shift. Set the dark background, saturation and contrast target, then export CSS variables or a Tailwind configuration.

Free to useNo account neededProcessed on your device
Your workspaceProcessed on your device

Theme preview

Background #221F11
  • surface#1A2422
    Surface
  • border#1D2624
    Surface
  • text#CFDCE3
    Aa Sample text
    11.79:1 on dark background · target met
  • muted#93A7AC
    Aa Sample text
    6.57:1 on dark background · target met
  • primary#A1CFDC
    Aa Sample text
    9.81:1 on dark background · target met
  • accent#D08B79
    Aa Sample text
    6.01:1 on dark background · target met
Adaptation

The contrast target applies to foreground colors over the generated dark background.

Named palette colors

Add this tool to your website

Paste this code into your page to add the tool and a visible ToolMellow credit link.

HTML embed code
Preview embed

Dark Mode Color Adapter: how to use it

  1. Choose a preset or name your own light colors. Classify each color as Foreground or Surface.
  2. Choose an adaptation mode, dark background lightness and saturation adjustment. Compare the samples in both themes.
  3. Set a foreground contrast target. Review the actual ratios and download CSS variables or the Tailwind v3 color configuration.

Limits and notes

Add one to twelve sRGB colors alongside an opaque output background. Dark background lightness ranges from 3% to 45%. Foreground checks support targets from 1:1 to 21:1 and retain the input alpha.

How your privacy works →

Dark Mode Color Adapter: common questions

What are the three modes?

Perceptual applies an eased reversal of HSL lightness. Invert reverses the lightness directly. Shift moves colors toward the lighter end of the dark theme range.

What happens when a contrast target is out of range?

The tool shows the highest ratio it can reach by changing the foreground's HSL lightness while holding hue, saturation and alpha fixed.

How does alpha affect the reported ratio?

Each foreground is blended over the actual exported dark background before computing the ratio. A low-opacity color can have a low attainable maximum even at the brightest source value.

How do I use the Tailwind export?

Load the downloaded CSS variables and merge the Tailwind v3 theme.extend.colors object into your project configuration. Your theme selector changes the colors of utilities that use those tokens.

Guides