Visual Accessibility in Games: Colorblind Design, Contrast, and Scalable UI
Color Vision Deficiency in Games
Color vision deficiency (commonly called color blindness) is not a binary condition. It exists on a spectrum, and the three main types each affect color perception differently. Deuteranopia (reduced green sensitivity) is the most common, affecting roughly 6% of men. Protanopia (reduced red sensitivity) affects about 1% of men. Tritanopia (reduced blue sensitivity) is rare, affecting less than 0.01% of the population. Deuteranopia and protanopia together are often called "red-green color blindness" because both types make it difficult to distinguish between reds and greens, though the specific colors affected differ.
For game designers, the critical rule is: never use color as the sole indicator of any gameplay-relevant information. If enemy health bars are red when low and green when full, a deuteranopic player cannot tell the difference. If team A is red and team B is green on a minimap, both teams look the same to roughly 7% of male players. If loot items are color-coded by rarity (gray, green, blue, purple, orange) without text labels or icons, colorblind players cannot determine item quality at a glance.
The solution is redundant encoding: every color distinction must also be communicated through shape, pattern, text, size, or position. A health bar that uses color can also display a percentage number. Team indicators can use both color and shape (circles vs. triangles). Loot items can display a rarity name alongside the color border. These redundant cues help everyone, not just colorblind players, because they add clarity that benefits players in any viewing condition, including bright sunlight on a phone screen or a low-quality monitor with poor color reproduction.
Beyond redundant encoding, provide a dedicated colorblind mode that shifts the game's palette to colors that are distinguishable across all three types of color vision deficiency. The safest palette for universal accessibility uses blue and orange as the primary contrast pair, since blue-orange distinction is preserved across all three CVD types. Avoid red-green pairings entirely in the default palette, and if the game's art direction requires them, provide a setting to swap them. Our colorblind modes guide walks through implementation using CSS custom properties and canvas filters.
Contrast Requirements
WCAG 2.2 specifies minimum contrast ratios for text: 4.5:1 for normal text (below 18px bold or 24px regular) and 3:1 for large text. These ratios are measured between the text color and its immediate background. In games, this applies to all UI text: menus, HUD elements, dialogue boxes, item descriptions, score displays, tutorial text, button labels, and any other text the player needs to read.
The challenge in games is that text often appears over dynamic backgrounds, a game world that changes as the camera moves. A white health bar text that has 7:1 contrast against a dark cave background drops to 1.5:1 against a snowy mountain. The solution is a text background: a solid or semi-transparent dark panel behind light text (or light panel behind dark text). This guarantees contrast regardless of the game world behind it. Most professional games use a slightly transparent dark rectangle behind HUD text, typically rgba(0, 0, 0, 0.7) or similar, which provides consistent contrast without completely blocking the game view.
Non-text UI elements (buttons, icons, health bar outlines, minimap borders, focus indicators) also need contrast. WCAG 1.4.11 requires a 3:1 contrast ratio for UI components and graphical objects that convey information. A health bar that blends into the background because its border has insufficient contrast is not just hard to see; it is a WCAG violation. Check all UI elements against their backgrounds, not just text.
Use a contrast checker during development, not after. Tools like the WebAIM Contrast Checker, the Chrome DevTools contrast inspector (in the Elements panel, click a color swatch to see its contrast ratio), or the axe browser extension can evaluate contrast in real time. If you check contrast only during a final accessibility review, you will find dozens of failures that require art asset changes, which is far more expensive than getting contrast right during initial design.
Scalable Text and UI
Players with low vision need text and interface elements larger than the default. The Xbox Accessibility Guidelines recommend a minimum text size of 28px at 1080p, which is larger than most indie games use for body text. WCAG 1.4.4 requires that text can be resized to 200% without loss of content or functionality. For web games, these requirements translate to specific CSS practices.
Use rem or em units for all text sizes, not fixed pixels. Set a base font size on the html element (e.g., html { font-size: 16px; }) and size everything relative to it. A text size slider in your settings menu then adjusts only the root font size, and all UI text scales proportionally. This approach is far simpler than manually resizing every text element because CSS inheritance handles the scaling automatically.
Use relative or percentage-based sizing for UI containers. A settings panel defined as width: 400px; will not scale with text, causing text to overflow at larger sizes. Use max-width: 90vw; or width: clamp(300px, 50vw, 600px); so the container adapts. Buttons should use padding in em units so they grow with their text content. Avoid fixed-height containers for any element that contains text, because the text will outgrow the container at larger sizes.
Test at 200% zoom in the browser. This is the simplest and most revealing accessibility test you can run. Navigate to your game, press Ctrl+Plus (or Cmd+Plus on Mac) until the browser is at 200% zoom, and verify that: all text is readable, no text is clipped or truncated, no buttons overlap, all menus are still navigable, and the game canvas is still functional. If anything breaks at 200% zoom, it is a WCAG 1.4.4 failure and needs fixing.
The game canvas itself (where rendering happens) does not need to scale with browser zoom, the rendering resolution is separate from the UI resolution. But any HTML/CSS overlay on top of the canvas (HUD, menus, dialogue, inventory) should scale correctly. Many web games use a hybrid approach: the game world renders at a fixed or configurable resolution on a canvas element, while all UI is built in HTML/CSS overlaid on top, inheriting browser zoom behavior automatically.
Photosensitivity and Motion Safety
Photosensitive seizures are a medical risk, not a preference. They can be triggered by flashing lights, rapid color changes, high-contrast strobing, and certain repetitive patterns. The consequences range from discomfort to full seizures that can cause injury. WCAG 2.3.1 (Level A, meaning the absolute minimum baseline) requires that no content flashes more than three times per second. WCAG 2.3.2 (Level AAA) eliminates all flashing entirely.
In games, common photosensitivity triggers include: screen flash effects on hits or explosions, rapid weapon muzzle flashes, strobe lighting in game environments, fast camera shake, rapid alternation between high-contrast colors (especially red/dark patterns), and certain repeating geometric patterns. The safest approach is to provide a "reduced effects" setting that tones down or eliminates all of these: dimmer flashes, slower camera shake, fewer particles, and muted visual feedback.
The CSS media query prefers-reduced-motion lets web games detect the user's operating system preference automatically. When this preference is enabled, your game should reduce or eliminate: screen shake, parallax scrolling, rapid particle effects, transition animations, and any full-screen visual effects. This can be implemented with a single check at game startup:
Query window.matchMedia('(prefers-reduced-motion: reduce)') and store the result as a game setting. If the user has enabled reduced motion in their OS, default your game's motion settings to reduced. Let the player override this in the game settings for players who want to fine-tune the level of motion reduction. This is a nearly free accessibility feature, requiring just a few lines of code and conditional checks on your visual effects.
Low Vision and High Contrast
Low vision is distinct from blindness. Players with low vision have some usable sight but may need significant accommodations: very large text, high-contrast modes, simplified visual scenes, and magnification. Some low-vision players use screen magnifiers that zoom into a portion of the screen, which means your UI layout matters, if critical information is spread across opposite corners of the screen, a magnified view cannot see both at once.
A high-contrast mode for your game replaces subtle color distinctions with stark, obvious ones. UI elements get thick, bright borders. Text gets solid, high-contrast backgrounds. Game objects get clearly visible outlines. Interactive elements are highlighted prominently against non-interactive backgrounds. This mode does not need to be aesthetically pleasing; it needs to be functional. Many players who need high-contrast mode are accustomed to it looking different from the default and prioritize usability over visual polish.
The CSS media query prefers-contrast detects when a user has enabled high contrast in their OS. You can use this to automatically apply a high-contrast stylesheet to your game's HTML UI: thicker borders, higher contrast colors, and bolder text weights. For canvas-rendered game content, check the preference at startup and apply a corresponding rendering mode with more visible outlines, brighter highlights, and simplified backgrounds.
Visual accessibility starts with three non-negotiable rules: never rely on color alone, maintain 4.5:1 contrast for text, and use relative CSS units for scalable UI. Add a colorblind mode, respect prefers-reduced-motion, and test at 200% browser zoom. These six practices cover the vast majority of visual accessibility needs for web games.