Home▸Game Development▸WCAG Text Contrast Ratio: Luminance and Pass Thresholds (2D)

WCAG Text Contrast Ratio: Luminance and Pass Thresholds (2D)

The same WCAG contrast calculation on a flat sign with a live gauge, a lightness sweep chart and the pass or fail result for AA and AAA at the chosen text size.

Game Development2DModerate60 FPS📱 Mobile-adapted🟠 Blender⇄ 3D version
WCAG Text Contrast Ratio: Luminance and Pass Thresholds (2D) ↗ Open standalone

Mix text and background colours and read their WCAG contrast ratio from relative luminance, with sRGB gamma linearisation, text opacity and size deciding the AA and AAA pass marks. A probe sign sweeps text lightness from black to white to show where the ratio crosses 3, 4.5 and 7, and equal-luminance red and green pairs show why hue alone does not give contrast. A Blender-built wall and signs, with numerical checks of the luminance formula built in.

⚙ Under the hood

The same WCAG contrast calculation on a flat sign with a live gauge, a lightness sweep chart and the pass or fail result for AA and AAA at the chosen text size.

AccessibilityWCAGContrast RatioLuminanceColour Design

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)