A functional dark website color palette starts with a background between #0d0d0d and #1a1a1a, paired with off-white text like #e0e0e0 or #cccccc instead of pure white to reduce eye strain. Your text must achieve a minimum contrast ratio of 4.5:1 for normal text or 7:1 for AAA accessibility. UI components need at least 3:1 contrast against adjacent colors. Dark mode follows the same WCAG thresholds as light mode—there are no separate standards. Use desaturated accent colors rather than bright saturated hues, which cause halation on dark backgrounds. Test all color pairs with a contrast checker before implementation to verify they meet the 4.5:1 minimum for text and 3:1 for UI elements.
Text Color Choices for Dark Backgrounds
What text color should you use on a dark background? Off-white alternatives like #e0e0e0 or #cccccc work better than pure white (#ffffff), which causes eye strain due to excessive brightness contrast. Your text must meet a minimum contrast ratio of 4.5:1 for normal text to satisfy Level AA accessibility standards. For enhanced Level AAA accessibility, aim for 7:1 contrast.
These contrast requirements apply identically to dark and light modes. WCAG measures contrast as a fixed ratio between relative luminance of colors, with thresholds that remain constant regardless of theme. A text color that meets 4.5:1 on a dark background provides the same accessibility as a dark text color meeting 4.5:1 on a light background.
Test each combination with a contrast checker to verify compliance before deployment. Large-scale text (18pt and larger, or 14pt bold) requires only 3:1 contrast for Level AA, giving you more flexibility with lighter gray tones for headings and display text. For Level AAA, large text needs 4.5:1 contrast.
Choose text colors based on your specific background value. Verify the exact ratio with a contrast checker, as small changes in either value can affect compliance.
Contrast Requirements for Dark Mode
Does dark mode have different contrast requirements than light mode? No. WCAG 2.2 applies identical contrast ratio requirements to both themes: 4.5:1 minimum for normal text (Level AA), 7:1 for AAA, and 3:1 for UI components and graphical objects.
Contrast ratio is measured between the relative luminance of two colors on a scale from 21:1 (pure black on pure white) with fixed thresholds that apply regardless of theme. The numerical ratio remains the same whether you place light text on a dark background or dark text on a light background. A 4.5:1 ratio means the lighter color has 4.5 times the relative luminance of the darker color, measured identically in both directions.
UI components like buttons, form borders, and icons must achieve at least 3:1 contrast against adjacent colors. This applies to the component's visual boundary against its immediate background, not the entire page background. Test the contrast between the component's fill color and its immediate surrounding surface.
Many designers mistakenly assume dark mode permits lower contrast ratios. This misconception leads to inaccessible interfaces that fail WCAG compliance. Use the same testing tools and thresholds for dark palettes as you would for light palettes.
Why Bright Colors Appear Harsh on Dark Backgrounds
Why do bright colors look harsh on dark backgrounds? High-saturation, bright colors create excessive luminance contrast against dark surfaces, causing visual strain. This occurs because the same contrast ratio produces different perceptual effects depending on whether light or dark is dominant.
While contrast ratios work in reverse (light text on dark versus dark text on light), they must meet the same numerical thresholds. A bright cyan (#00ffff) on black (#000000) achieves a high contrast ratio but appears visually uncomfortable due to the extreme luminance difference and high saturation. The color's intensity overwhelms the dark context, making it difficult to focus on text or UI elements.
Desaturate accent colors to reduce harshness while maintaining required contrast ratios. Lower saturation reduces the perceptual intensity while preserving the luminance difference needed for accessibility. Choose accent colors with moderate lightness values rather than near-maximum brightness.
Test accent colors in context—what appears acceptable in isolation may prove harsh when surrounded by dark surfaces across an entire interface. Colors in the mid-range lightness typically offer enough contrast for interactive elements without causing discomfort.
Building a Complete Dark Color Palette
Follow these steps to construct an accessible dark color palette:
Select your base background color. Common ranges fall between #0d0d0d and #1a1a1a. Darker backgrounds provide more contrast headroom for text, while slightly lighter values reduce the overall darkness for interfaces with extensive content.
Choose a primary text color that meets 4.5:1 contrast minimum. Test off-white values like #e0e0e0 or #cccccc against your chosen background. Verify the exact ratio with a contrast checker, as small changes in either value can affect compliance.
Define 1-2 accent colors with appropriate saturation. Desaturate bright hues to reduce harshness. For links and interactive elements, choose colors that meet 4.5:1 contrast against your base background while remaining visually distinct from body text.
Establish surface elevation shades using subtle gray variations. Increment background lightness gradually to create depth. Test each surface level to ensure it remains visually distinct from adjacent layers while maintaining overall cohesion.
Ensure UI components meet 3:1 contrast against adjacent colors. Button borders, form field outlines, and icon strokes must achieve 3:1 contrast against their immediate background. Test each component's visual boundary against its surrounding surface.
Ready-to-Use Dark Palette Template
| Element | HEX Code | Purpose | Notes |
|---|---|---|---|
| Base Background | #121212 | Main page background | Foundation for all elements |
| Elevated Surface | #1e1e1e | Cards, panels | Subtle depth without shadows |
| Modal Background | #2a2a2a | Overlays, dialogs | Clear visual hierarchy |
| Primary Text | #e0e0e0 | Body text, headings | Test contrast before use |
| Secondary Text | #b0b0b0 | Captions, metadata | Verify 4.5:1 minimum |
| Link Color | #6a9fd8 | Hyperlinks | Desaturated blue |
| Accent Color | #5a9e7c | Buttons, highlights | Muted green |
| Border Color | #3a3a3a | Dividers, outlines | Verify 3:1 minimum |
| Error Color | #d87a7a | Error messages | Desaturated red |
| Success Color | #7ac89e | Success messages | Muted green |
Test all color pairs with a contrast checker before finalizing your palette. WebAIM's Contrast Checker and browser developer tools provide quick verification. Adjust HEX values incrementally if a pair falls below the required threshold—small changes in lightness often resolve compliance issues without altering your design's visual character.
Finding Dark Palette Generators and Community Resources
Several online tools generate dark color palettes with accessibility checks built in. Search for "dark mode color palette generator" to find tools that calculate contrast ratios automatically and suggest compliant alternatives. Many generators allow you to input a base color and receive a complete palette with verified contrast ratios.
Community discussions on platforms like Reddit often share tested dark palettes and real-world implementation experiences. Search subreddits focused on web design, UI/UX, or accessibility for threads discussing dark mode color schemes. Users frequently post their palettes with HEX codes and contrast ratios, along with feedback on what works in production environments.
GitHub repositories also host open-source dark palette collections with documented contrast ratios. These collections often include CSS variables and design tokens ready for implementation. Look for repositories tagged with "dark-mode," "color-palette," or "accessibility" to find community-maintained resources.
Before adopting any palette from a generator or community source, verify all contrast ratios with your own testing tools. Automated generators sometimes produce values that appear compliant but fail when tested against specific backgrounds or in different rendering contexts.
Q&A
- Does dark mode have different contrast requirements than light mode?
No. WCAG 2.2 applies identical contrast ratio requirements to both themes: 4.5:1 minimum for normal text, 7:1 for AAA, and 3:1 for UI components. Contrast ratio is measured between relative luminance on a fixed scale with thresholds that apply regardless of theme.
- What text color should I use on a dark background?
Use off-white alternatives like #e0e0e0 or #cccccc instead of pure white to reduce eye strain, ensuring your text meets the minimum 4.5:1 contrast ratio required by WCAG Level AA. For enhanced AAA accessibility, aim for 7:1 contrast.
Where to look next
These services are useful starting points for further research. Tools & services.