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.
Convert a Light Palette to Dark Mode
Theme preview
#221F11- surfaceSurface
#1A2422 - borderSurface
#1D2624 - text
#CFDCE3Aa Sample text11.79:1 on dark background · target met - muted
#93A7ACAa Sample text6.57:1 on dark background · target met - primary
#A1CFDCAa Sample text9.81:1 on dark background · target met - accent
#D08B79Aa Sample text6.01:1 on dark background · target met
Dark Mode Color Adapter: how to use it
- Choose a preset or name your own light colors. Classify each color as Foreground or Surface.
- Choose an adaptation mode, dark background lightness and saturation adjustment. Compare the samples in both themes.
- 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.