Dark Mode Preference Checker

Dark Mode Preference Checker reads five separate OS-level signals your browser exposes — color scheme, reduced motion, reduced transparency, forced colors, and contrast preference — and lists each one's current value the moment you load the page. Flip your system theme in another window or in Settings and watch the rows update live, so you can confirm your site actually responds the way you built it to. It's the fastest way to check what a real visitor's OS is telling their browser before you go digging through devtools. The viewport size checker online runs entirely in your browser — nothing you enter is ever sent to a server.

Your Preferences

Flip your OS theme or accessibility settings in another window — these rows update live.

What Each One Means

Ever wondered how your website or HTML email actually displays in night-theme mode across every major client? The Dark Mode Preference Checker reveals exactly that — giving you a side by side preview of how your colors, text, and layout transform under each client's unique inversion algorithm, so you can fix tonal issues and protect your brand colors prior to sending or shipping to production. Whether you're a frontend developer tuning an adaptive design or an email marketer making sure your campaign looks polished for the 82% of Apple users who browse with dark theme enabled, understanding your palette under every condition is the difference between a professional result and unreadable emails. Good UX and solid web design both depend on ensuring readability across every viewing environment, and email development is no exception.

How This Dark Mode Preference Checker Detects Your Color Scheme Preference

Detecting Night-Theme Settings with the prefers-color-scheme Condition

Every modern operating system — macOS, iOS, Android, Windows — exposes the user's preferred palette through a system-level signal. Engines surface this signal to your styles via the prefers-color-scheme media query, a web standard that lets you write conditional rules that activate only when the OS reports dark mode is enabled. This is the foundation of all reliable night-theme detection in web development and email design alike.

Here is the core styling syntax. Anything nested inside this block overrides your default light styles thanks to the cascade:

/* Default light theme styles */
body {
  background-color: #ffffff;
  color: #1a1a1a;
}

/* Dark override via prefers-color-scheme */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #121212;
    color: #e8e8e8;
  }
  a {
    color: #90caf9;
  }
  .card {
    background-color: #1e1e1e;
    border-color: #333333;
  }
}

This conditional rule is a staple of adaptive design and cross-client support. It works in Chrome, Edge, Firefox, Safari, and most modern mobile clients. You can even test it live using your engine's developer tools — in Firefox developer tools and Chrome's F12 tools, you can emulate the preferred palette without changing your actual OS preference, making theme testing fast during development.

Some developers prefer to lean on style variables within a design system so that only the variable values need to change between light mode and the inverted view — keeping the rest of the cascade intact and avoiding a maintenance nightmare of duplicate rule sets. Using !important overrides is sometimes unavoidable with older third-party widgets, though it should be a last resort.

Best practice: Give your users the option to switch between light and dark — don't force either mode upon them. Offering a toggle that respects both the OS night-theme signal and a manual override creates the best experience and accommodates users with accessibility needs who rely on high-contrast display settings.

Reading the Night-Theme Signal with JavaScript and matchMedia

Styles handle most visual theming automatically, but some scenarios — like third-party iframes, podcast player embeds, or URL querystring-driven widgets — require JavaScript dark mode detection to respond at runtime. The window.matchMedia API is the correct tool for this. It mirrors the prefers-color-scheme condition in script, returning a live MediaQueryList object that you can both read and listen to for changes.

// Detect and respond to night-theme preference with script
if (window.matchMedia) {
  var match = window.matchMedia('(prefers-color-scheme: dark)');

  // Apply the initial state on page load
  applyDarkTheme(match.matches);

  // Listen for OS-level theme change
  match.addEventListener('change', function(e) {
    applyDarkTheme(match.matches);
  });
}

function applyDarkTheme(isDark) {
  // Example: inject dark=true into a third-party iframe src
  let playerFrame = document.querySelector('#mediaPlayerIframe');
  if (playerFrame) {
    let src = new URL(playerFrame.src);
    src.searchParams.set('dark', isDark ? 'true' : 'false');
    playerFrame.src = src.toString();
  }

  // Example: toggle a class on the root element
  document.documentElement.classList.toggle('dark-mode-skin', isDark);
}

The addEventListener change pattern ensures your page reacts seamlessly if the user switches their system theme mid-session — from light to inverted or back — without a page reload. The applyDarkTheme function handles both the initial state on load and every subsequent theme change. Using searchParams to set the theme=dark querystring on a third-party embed (rather than string concatenation) is a robust, modern approach that avoids duplicating parameters.

For ASP.NET or any server-rendered page, you can also pass the detected preference as a URL querystring parameter to control server-side rendering logic, giving vendor night-theme integrations full context even before script runs on the client. This is particularly relevant for iframe scenarios where dynamic inline rules cannot penetrate the iframe boundary.

Understanding the CIELAB Lightness Inversion Formula

Several email clients — including the Gmail Android app, Gmail iOS app, Outlook Windows desktop, and Samsung Mail — use the CIELAB color model (L*a*b*) for their night-theme color transformation rather than simply inverting raw RGB values. CIELAB is a perceptually uniform representation where equal numerical steps correspond to equal perceived differences in color. This makes it far better than RGB for producing natural-looking results.

The L* channel (lightness) runs from 0 (pure black) to 100 (pure white). Inverting it with the simple formula:

l = 1 − l   (normalized 0–1 scale)

...or equivalently L* → 100 − L* on the standard scale, flips light colors dark and dark colors light while preserving hue and apparent saturation. This is why lightness inversion via CIELAB looks more natural than naive RGB inversion, which shifts colors toward warm-neutral hues and produces muddy output. The a* shift applied by Outlook Windows to highly vivid greens is a further refinement that prevents those tones from becoming unpleasant after inversion — without it, vivid greens would shift toward an unpleasant cyan-gray tone due to how HSL lightness mapping and CIELAB interact at high chroma values.

The cielab l* inversion approach also better preserves hue fidelity across the color transformation, meaning brand colors tend to remain recognizable even after inversion — a significant advantage for email marketing consistency.

Dark Mode Support Across Email Clients and Environments

Email Client Night-Theme HTML Rendering Breakdown

No area of web development is more fragmented than night-theme email HTML rendering. Each major email client applies its own distinct algorithm — there is no standard, which is why the same HTML email can look completely different depending on where it is opened. Here is how each supported client handles the color transformation, relevant to color science and what the dark mode preference checker reveals: A quick pass through the screen orientation checker catches issues before they become real problems.

  • Gmail Android: Uses CIELAB L* inversion with brightness thresholds. Dark text (perceived brightness below 150) is inverted; light backgrounds (brightness above 205) are inverted. Mid-range colors are left untouched. This is the same algorithm used by Android WebView's force-dark mode, making the Gmail Android app's output predictable but selective.
  • Gmail iOS: Applies full CIELAB L* inversion to all colors unconditionally — the most aggressive transformation of any major client. No brightness threshold filtering. Every color in your HTML email is inverted, including colors that the Gmail Android client would leave alone. This means the Gmail iOS app can dramatically shift even carefully chosen brand colors.
  • Outlook.com / iOS / Android: Runs a fixContrast algorithm (the fixContrast() function) rather than blanket inversion. It first checks the tonal ratio against the WCAG 4.5:1 standard. If the ratio is insufficient for legibility, it uses CIELAB L* to push colors toward a readable extreme. This makes Outlook.com the most accessibility-conscious of the major email clients — but it also means colors can shift unexpectedly when they fall near the threshold.
  • Outlook Windows: Uses CIELAB lightness inversion with the formula (target − L) × 0.82, where the target L* is 117 for most colors or 127 for reddish-neutral hues. Highly vivid greens receive an additional a* shift to prevent the muddy output that naive inversion would produce. The Outlook Windows desktop client's output is thus more nuanced than a simple flip, and results can differ visibly from other clients even starting from the same email colors.
  • Apple Mail: Performs a pure black swap and pure white swap first, then applies HSL lightness inversion (l = 1 − l in the hue-saturation-lightness formula) to colors that are very bright or very dark. Critically, Apple Mail fully respects the color-scheme meta tag — if you declare <meta name="color-scheme" content="light dark">, Apple Mail will not apply automatic inversion, letting your explicit styles take full control. Apple users represent a significant portion of mobile email opens, so this support is valuable.
  • Samsung Mail: Uses the same Android WebView force-dark engine as the Gmail Android app for its CIELAB color inversion. It also respects the color-scheme meta tag. However, Samsung Mail adds an additional layer: auto-fit scaling behavior driven by AutoFit.js, sourced from the Samsung APK via decompiled source analysis. This scaling layer creates unique layout problems described below.

Keeping Email Colors Readable in Both Light and Inverted Environments

Working to ensure readability of your email colors in any mode requires understanding which clients will transform them and which will respect your explicit choices. The most reliable and future-proof approach is to write explicit dark styles using the @media (prefers-color-scheme: dark) block directly in your HTML email's <style> tag. Apple Mail will honor these completely. Gmail and Outlook, however, apply their own color algorithm regardless of the color-scheme meta tag or explicit overrides — which is why previewing in a dark mode preference checker prior to sending is so important for email marketing deliverability and brand consistency.

The color-scheme meta tag approach looks like this:

<!-- Signals to Apple Mail and some clients that night-theme is supported -->
<meta name="color-scheme" content="light dark">
<meta name="supported-color-schemes" content="light dark">

<style>
  @media (prefers-color-scheme: dark) {
    body { background-color: #1a1a1a !important; color: #ffffff !important; }
    .cta-button { background-color: #0a84ff !important; }
  }
</style>

To stop unwanted inversions in clients that ignore the meta tag, the strategy is to ensure your email's colors already pass the WCAG 4.5:1 tonal ratio check in both light and inverted environments. The fixContrast() technique used internally by Outlook.com's color algorithm applies the formula:

Adjusted L* = (target − L) × 0.82

Where:
  target = 117 for most colors (or 127 for reddish-neutral hues)
  L      = original CIELAB L* value of the color
  Result = new lightness value pushed toward the readable extreme

Colors that produce invisible text — such as a white headline on a white-inverted background — are the most critical failure mode. A tonal check using a night-theme color checker or this tool's live preview catches these before they reach your subscribers. The color render differences between clients also make brand colors look inconsistent across platforms, which is a brand consistency risk in email layouts that is easy to overlook without a side by side preview.

Samsung Mail Auto-Fit Scaling and Why It Breaks Adaptive Layouts

Samsung Mail introduces a separate rendering challenge beyond color inversion: its auto-fit scaling behavior, powered by AutoFit.js extracted from the Samsung APK. This is an auto-fit simulation that runs before color transforms and can significantly disrupt your adaptive email layout.

Here is what happens step by step:

  1. Samsung Mail scans every element in your HTML for pixel width attributes — specifically HTML width attributes like <img width="600">. It prioritizes these dimension values over inline rules, inverting the normal precedence of the cascade.
  2. If any img width attribute or table width exceeds the device's 360px viewport (a common viewport width for mid-range Android phones), Samsung Mail triggers viewport injection — it injects a wider virtual viewport and zooms the entire layout to fit within the available space.
  3. Android's built-in text auto-sizing then inflates text back to a legible size at the shrunk scale. The result: images and layout elements remain at the zoomed-down size, but text appears disproportionately large text — a layout shrink effect that can make your email look completely broken.

The fix: Remove pixel width attributes from your email's outer elements and images. Use max-width in inline styles instead. If you need to retain width attributes for the Outlook Windows desktop client's support, wrap them in conditional comments that Samsung Mail ignores — since Samsung Mail does not parse MSO conditional comments, your dimension values will be hidden from the scaling script while remaining visible to Outlook's engine.

Common Questions About This Dark Mode Email Color Checker

Why do my email colors look different across every client in night-theme mode?

Each email client implements its own per-client algorithm for night-theme transformation. The Gmail Android app uses brightness thresholds before CIELAB inversion; the Gmail iOS app inverts all colors unconditionally; Outlook.com checks tonal ratio first; Apple Mail uses hue-saturation-lightness inversion on extreme brightness values only; Samsung Mail applies Android WebView's engine plus scaling. There is no shared standard for email output in night-theme mode, which is exactly why a previewer and simulator like this tool is essential for email testing prior to sending. Use Outlook iOS and Outlook Android previews alongside the others to cover all major clients.

Does this tool upload my HTML email to any server?

No. This is a fully client-side tool that operates through in-browser processing and local script execution. When you paste HTML, upload HTML, or submit a zip file containing your email and images, the DOM transformation, color math, and all processing happen entirely in your environment. Your HTML is never sent to any server — there is no server involved. This makes it safe for confidential campaign work, consistent with privacy-first web development practices, and free to test without registration — a true test-free workflow.

What is CIELAB and why does it matter for email night-theme?

CIELAB (also written L*a*b*) is a perceptually uniform color model developed to better represent how human vision perceives differences in color. Unlike RGB, equal numerical steps in CIELAB correspond to equal perceived differences. The L* channel encodes lightness from 0 (black) to 100 (white). Email clients use cielab l* inversion because inverting the luminance axis preserves hue fidelity and apparent saturation — qualities that raw RGB inversion destroys. For example, simple RGB inversion of orange produces a muddy blue-gray; the CIELAB approach preserves the warmth of the hue while shifting its luminance. This is why email clients have adopted CIELAB-based color transformation as the preferred color algorithm for their dark text inversion and light background inversion logic.

How accurate are these night-theme simulations?

The simulations for Gmail, Outlook, and Apple Mail are based on documented client behavior and have been verified against real devices. Samsung Mail's auto-fit simulation and color transform are based on the decompiled source of the scaling script from the Samsung Email APK — the most accurate available source for that client's behavior. Real-world output varies by app version, OS version, display settings, and account configuration. Use these previews as a night-theme safe baseline check — always validate critical sends with real device testing. The tool is designed to give you confidence across clients where manual testing is slow, not to replace device testing entirely.

How do I prevent night-theme from changing my email's colors?

The most reliable method is to use @media (prefers-color-scheme: dark) rules in your <style> block with explicit dark styles that define exactly how your email should look — this gives Apple Mail full control to your design. Adding the color-scheme meta tag (<meta name="color-scheme" content="light dark">) reinforces this for Apple Mail and some web-based email clients. For Gmail and Outlook, which apply forced color inversion regardless of your declarations, the best defense is ensuring your email colors already have sufficient tonal contrast in their post-inversion state — which is exactly what this dark mode email color checker lets you verify. Use override rules with care, and test for legibility issues and invisible text in every supported client before sending. This approach supports both prefers dark mode users and those on standard themes.

For deeper exploration of night-theme resources, the community references that email developers and web designers rely on include CSS-Tricks for comprehensive styling and night-theme guides, Email on Acid and Litmus for professional email testing and mobile email output analysis, and Can I Email for current prefers-color-scheme support data across email clients. For web-focused night-theme detection and client-preference support, MDN Web Docs provides authoritative references on the prefers-color-scheme media query, matchMedia, and related web standards. Use this dark mode preference checker alongside those resources to ensure your email layouts and web UI meet both accessibility and readability standards in any mode — giving every subscriber, regardless of their user preference or system preference, a visually comfortable experience that honors your brand colors and supports visual comfort across every operating system and user interface.

Frequently Asked Questions

Why does my email look different in dark mode across different clients?
Each email client implements its own dark mode algorithm. Gmail Android uses CIELAB L* inversion with brightness thresholds, Gmail iOS applies full inversion to all colors unconditionally, and Outlook uses a WCAG contrast-checking algorithm called fixContrast(). Because these approaches differ, the same color can transform very differently across clients. Testing each one separately is the only reliable way to ensure consistent results.
How do I stop dark mode from changing my email colors?
You can use the CSS property color-scheme to signal your intent, and add @media (prefers-color-scheme: dark) overrides with !important declarations to force your chosen colors. Setting explicit background and text colors on all elements — rather than relying on defaults — also reduces unwanted transformations. Some clients still override colors regardless, so testing is essential.
What is CIELAB and why do email clients use it?
CIELAB is a perceptually uniform color space that models how human vision perceives differences in color and lightness. Gmail uses CIELAB L* (lightness) values to decide whether a color should be inverted in dark mode — colors above or below certain brightness thresholds get transformed while mid-range colors are left alone. This approach is more accurate to human perception than simple RGB brightness calculations.
What does the contrast ratio mean?
Contrast ratio measures the difference in luminance between your foreground color and its background. WCAG (Web Content Accessibility Guidelines) requires a minimum ratio of 4.5:1 for normal text and 3:1 for large text at the AA compliance level. A ratio of 7:1 or higher meets the stricter AAA standard. Low contrast ratios make text hard to read, especially for users with visual impairments.
How accurate are these dark mode simulations?
This tool implements the known published algorithms for each major client as closely as possible, including CIELAB math and brightness thresholds. However, email and browser clients may update their algorithms over time, and some behavior can vary by OS version or client update. Treat the results as a highly reliable guide, but always send test emails to real devices for final verification.
What is the difference between light mode and dark mode brightness?
Brightness is calculated from the RGB values of a color using a weighted formula that accounts for human perception (the eye is more sensitive to green than red or blue). Light mode brightness reflects your original color. Dark mode brightness reflects the transformed color after the selected client's algorithm is applied. Comparing the two helps you understand how dramatically the color has shifted.
Does this tool send my color data anywhere?
No. All calculations in this tool run entirely in your browser using JavaScript. Your color values are never sent to a server or stored anywhere. You can use it safely with brand colors or proprietary design tokens.
What does the CSS prefers-color-scheme media query do?
The @media (prefers-color-scheme: dark) CSS rule lets you apply different styles when the user's operating system is set to dark mode. Browsers like Chrome, Firefox, and Safari read the OS preference and activate the matching CSS block automatically. This is the standard web approach and gives developers full control over how colors change — unlike email clients which apply their own transformations.