🧰 ToolPicoAll Tools →
HomeBlog › Dark Mode Contrast Bugs

Dark Mode Contrast Bugs: Testing Transparent UI and APCA Scores

Your light-mode colors passed the audit. Then you shipped a dark theme, a glassy overlay card, and a translucent nav bar — and now something feels harder to read, but the numbers "should" be fine. This is the guide for that specific failure mode: alpha compositing, dark-mode luminance flips, and why APCA sometimes disagrees with the plain WCAG ratio.

In this guide

Why does my translucent overlay text look fine in the design file but fail in the browser?

Quick answer: A semi-transparent color has no fixed contrast value on its own — its effective, rendered color depends on whatever sits behind it, so the same 70%-opacity white overlay can pass against a dark hero photo and fail against a light one.

Design tools frequently report contrast against the raw swatch color, ignoring alpha. But browsers composite the layers, so the color a user actually reads is the blended result. The correct way to check it: effective color = foreground × alpha + background × (1 − alpha), applied per channel, then run the standard relative-luminance formula on that composited value.

Example (illustrative): imagine white text at 80% opacity (rgba(255,255,255,0.8)) sitting over a mid-tone photo that averages around #4a4a52. The rendered text is not pure white — it is a blend closer to a light gray, and its real contrast ratio against that photo can land noticeably lower than the 21:1 you'd get from "white on black" math. Skipping the alpha step is one of the easiest ways to accidentally ship a low-contrast hero caption.

A checker that parses rgba(), hsla(), and 8-digit hex (like #ffffffcc) directly can composite this automatically instead of forcing you to do the blend math by hand for every overlay variant.

Does switching to dark mode automatically fix low contrast?

Quick answer: No — inverting a theme does not invert the math. A gray that barely passed on a white background can land in a completely different (better or worse) place once the background is near-black, because relative luminance is not symmetric around the midpoint.

A common dark-mode habit is taking a light theme's exact color tokens, flipping the background to near-black, and assuming the existing text/accent colors "will obviously be fine now." In practice, each pair needs its own independent check. A saturated brand color that was legible as body text on white (dark, low luminance, high contrast against a bright background) can become one of the weakest pairs in the whole theme once the background itself turns dark, because both colors now sit closer together on the luminance scale.

Rule of thumb: treat your dark theme as a brand-new palette to audit, not a filter applied to the light one. Re-run every text/background and button/icon pair through a contrast checker after the flip, rather than assuming the light-mode pass carries over.

When does APCA disagree with the plain WCAG ratio, and why does it matter for dark mode?

Quick answer: APCA (the perceptual contrast method built for the WCAG 3 draft) accounts for polarity — light text on dark vs. dark text on light are scored differently even at an identical WCAG 2 ratio — which makes it more sensitive to a class of dark-mode readability issues the older ratio formula tends to under-report.

WCAG 2's ratio is symmetric: swap the two colors and the number doesn't change. Real human perception isn't symmetric that way, especially for lighter-weight fonts on dark backgrounds, which is part of why some teams see a pair pass the classic 4.5:1 check and still get flagged as "hard to read" in dark mode by actual users. Checking the APCA Lc score alongside the WCAG ratio surfaces that gap instead of leaving it as an anecdotal complaint from your design team.

Rough APCA Lc guidance by content weight (approximate, not a formal legal standard)
Content typeApprox. minimum Lc
Body text~75
Larger content text~60
Large headings~45

A quick workflow for auditing a dark theme or glass UI

  • List every real pair. Don't just check body text — separately check nav links, button labels, disabled-but-still-informative text, and icon-on-background pairs, since dark themes often forget the smaller elements.
  • Enter alpha values as-is. If a token is defined as rgba() or an 8-digit hex, paste it exactly rather than "simplifying" it to an opaque color first — the alpha is part of what makes it fail or pass.
  • Check both WCAG ratio and APCA. Treat a WCAG pass with a low APCA score as a signal to bump contrast a little further, not as a false alarm to ignore.
  • Re-test after any lightness tweak. A single-step lightness shift to fix one pair can quietly break a different pair that shares the same token.
Test alpha, dark mode, and APCA in one pass

Paste rgba/hsla/8-digit hex colors directly, see the composited WCAG ratio and the APCA Lc score side by side, and preview the pair live — free, no signup.

Try the free Color Contrast Checker →

Frequently asked questions

Why does my overlay text pass contrast in Figma but fail in the browser?

Design tools often show the flat swatch color, not what actually renders once a semi-transparent layer sits on top of a background. A translucent white overlay at 70% opacity over a photo does not have a single fixed contrast value — its effective color changes with whatever is behind it, so the same overlay can pass on a dark photo and fail on a light one.

How do I calculate the real contrast of a semi-transparent color?

Composite the translucent color over its background first: effective color = foreground × alpha + background × (1 − alpha), applied per RGB channel, then run the standard WCAG relative luminance formula on that composited result. This is what a color contrast checker with alpha (rgba/hsla/8-digit hex) support does automatically instead of making you calculate it by hand.

Does dark mode automatically fix contrast problems?

No. Flipping a light theme's colors to dark does not guarantee the new pair passes the same threshold, because contrast ratio is not simply inverted — a light gray that was borderline-compliant on white can become clearly non-compliant on near-black, or vice versa. Each dark-mode color pair needs its own independent check, not an assumption based on the light-mode result.

When should I use APCA instead of the WCAG 2 ratio for dark mode?

APCA is especially useful for dark mode because it accounts for polarity — light text on a dark background is scored differently than dark text on a light background, even at the same numeric WCAG ratio, which better matches how people actually perceive dark-mode readability. Checking both scores side by side catches cases where a pair technically clears the WCAG ratio but still reads as low-contrast in APCA's perceptual model.

What's a common dark-mode contrast mistake in real interfaces?

A frequent pattern (illustrative, not a universal rule) is reusing a brand accent color for both link text and button fills without re-checking it against the dark background — a saturated brand purple that reads clearly on white can turn muddy and low-contrast against near-black, especially for smaller link text, because its relative luminance sits much closer to the dark background's luminance than to white's.

Related guides

Methodology note: The examples above are illustrative and use example or approximate values to explain how alpha compositing and APCA behave — they are not a substitute for testing your own site's exact colors and fonts. This guide is for general informational purposes and is not legal accessibility advice; consult WCAG's official documentation or an accessibility professional for compliance-critical projects.