# Wcag color contrast

> Wcag color contrast is an open-source agent skill for design and media. Checks color pairs and design tokens against WCAG contrast ratios for text and UI. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/testland/qa/tree/main/plugins/qa-accessibility/skills/wcag-color-contrast
- **Repository:** https://github.com/testland/qa
- **GitHub stars:** 18
- **License:** MIT
- **Skill name:** wcag-color-contrast
- **Collection:** https://github.com/testland/qa
- **Categories:** [design and media](https://ai-powered.com/categories/design-and-media)
- **Listing updated:** 2026-12-04

## About

This skill gives the agent the WCAG 2.2 color-contrast rules for text, large text and non-text UI elements at AA and AAA levels, along with the luminance-based ratio formula. It covers the thresholds an agent should apply when a user asks whether a few hex values pass, why some text is hard to read, or how a palette or component should be reviewed.

Beyond the rules, the skill lists common failure patterns such as light gray text, placeholder text, brand-colored buttons and focus rings, each paired with a fix. It also flags anti-patterns like relying on opacity or checking only design tokens without checking rendered output or dark mode.

For bulk work it includes a Node.js example that uses the polished library's getContrast function to test pairs of design tokens and exit with an error on violations, intended for CI. It also points to tools such as WebAIM's checker and axe-core and to related skills for keyboard focus and accessibility gates.

## When your agent uses it

> Use for any question about color contrast or whether colors pass WCAG, including quick checks of a few hex values and hard-to-read text: WCAG 2.2 text, large-text and non-text contrast ratios (4.5:1, 3:1) at AA and AAA, the measurement formula, palette and component reviews, and bulk checks over CSS and design tokens.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/testland/qa/tree/HEAD/plugins/qa-accessibility/skills/wcag-color-contrast)
- [License: MIT](https://github.com/testland/qa/tree/HEAD/plugins/qa-accessibility/skills/wcag-color-contrast)

## Features

- **Text contrast thresholds:** Covers the 4.5:1 and 3:1 minimums for normal and large text under AA, and the stricter AAA values.
- **Non-text contrast rules:** Explains the 3:1 requirement for UI components, focus indicators and graphical state cues.
- **Hover and focus content:** Describes the dismissable, hoverable and persistent conditions for tooltips and popovers.
- **Contrast formula reference:** States the relative luminance ratio formula and lists common color pairings with their ratios.
- **Design token bulk checks:** Provides a Node.js script using polished to test token pairs and fail on violations.
- **Common failure fixes:** Lists frequent contrast problems in components with a suggested fix for each.

## Good for

- Check whether a set of hex colors passes WCAG AA for body text
- Review a button or form component's CSS for contrast violations
- Audit design tokens for text and background pairs that fall below 4.5:1
- Set up a CI check that fails when color token pairs have low contrast
- Fix a light gray placeholder or focus ring that is hard to see

## Install

### Claude Code

This skill ships in the `qa-accessibility` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add testland/qa
/plugin install qa-accessibility@testland-qa
```

Or copy only this skill to `~/.claude/skills/wcag-color-contrast`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/testland/qa.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/wcag-color-contrast &&
cp -R "$tmp/plugins/qa-accessibility/skills/wcag-color-contrast" ~/.claude/skills/wcag-color-contrast &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/wcag-color-contrast` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/wcag-color-contrast` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/testland/qa.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/wcag-color-contrast &&
cp -R "$tmp/plugins/qa-accessibility/skills/wcag-color-contrast" ~/.agents/skills/wcag-color-contrast &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/wcag-color-contrast` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/wcag-color-contrast` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/testland/qa.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/wcag-color-contrast &&
cp -R "$tmp/plugins/qa-accessibility/skills/wcag-color-contrast" ~/.cursor/skills/wcag-color-contrast &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/wcag-color-contrast` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/testland/qa.git --path plugins/qa-accessibility/skills/wcag-color-contrast
```

Or copy the folder to `~/.gemini/skills/wcag-color-contrast` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/wcag-color-contrast`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/testland/qa.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/wcag-color-contrast &&
cp -R "$tmp/plugins/qa-accessibility/skills/wcag-color-contrast" ~/.copilot/skills/wcag-color-contrast &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/wcag-color-contrast` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/testland/qa.git
```

Then copy `qa/plugins/qa-accessibility/skills/wcag-color-contrast` into your agent's skills folder as `wcag-color-contrast`. Agents that support SKILL.md read one folder per skill.

## FAQ

### When does Wcag color contrast trigger?

It is meant for any question about color contrast or whether colors pass WCAG, including quick hex-value checks and hard-to-read text.

### Does Wcag color contrast run any scripts?

No scripts are bundled with the skill. It includes an example Node.js snippet using the polished npm package for token checks.

### Which WCAG versions and levels does Wcag color contrast cover?

It covers WCAG 2.2 success criteria 1.4.3, 1.4.6, 1.4.11 and 1.4.13 at AA and AAA levels.

### Which tools does Wcag color contrast recommend for measuring contrast?

It mentions the WebAIM Contrast Checker, Chrome DevTools, Figma plugins such as Stark and Able, the polished getContrast function, and axe-core.

### How do I install Wcag color contrast in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/wcag-color-contrast to use it in all your projects, or to .claude/skills/wcag-color-contrast in one project. Or install the qa-accessibility plugin, which includes it: /plugin marketplace add testland/qa, then /plugin install qa-accessibility@testland-qa.

### Does Wcag color contrast run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Wcag color contrast?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Wcag color contrast?

The closest alternatives to Wcag color contrast are Color theory, App UI design, Figma a11y review, Design system and Design review.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Color theory](https://ai-powered.com/skills/color-theory): Color theory is an open-source agent skill for design and media.
- [App UI design](https://ai-powered.com/skills/app-ui-design): App UI design is an open-source agent skill for design and media.
- [Figma a11y review](https://ai-powered.com/skills/figma-a11y-review): Figma a11y review is an open-source agent skill for design and media.
- [Design system](https://ai-powered.com/skills/design-system-smartworldarafath): Design system is an open-source agent skill for design and media.
- [Design review](https://ai-powered.com/skills/design-review): Design review is an open-source agent skill for design and media.
- [Antislop UI](https://ai-powered.com/skills/antislop-ui): Antislop UI is an open-source agent skill for design and media.
- [UI UX design](https://ai-powered.com/skills/ui-ux-design-ajyadav013): UI UX design is an open-source agent skill for design and media.
- [Tastemaker](https://ai-powered.com/skills/tastemaker-codeswithroh): Tastemaker is an open-source agent skill for design and media.

---
Source: https://ai-powered.com/skills/wcag-color-contrast
