# Contrast checker: APCA and WCAG 2

Type a text colour and a background, as hex or OKLCH, and the checker gives the APCA Lc, the WCAG 2 ratio and the smallest text the pair can carry under Meadowstack's thresholds. Further down, paste your colour tokens as CSS and it measures every text token on its backgrounds in each theme, the weakest pair first. Both tools run in your browser and send nothing anywhere.

Checked 2 December 2026. By Bohuslav Poláček. https://meadowstack.com/tools/apca-contrast-checker/

*It computes in your browser with the same code as the site's contrast tables (APCA-W3 0.0.98G-4g).*

An interactive tool that runs in the browser on the page: https://meadowstack.com/tools/apca-contrast-checker/

## How to read the result

- **Lc**: APCA's contrast. Light text on a dark background gives a negative number; its size is what counts.
- **Ratio**: WCAG 2's, from 1:1 to 21:1.
- **Carries**: the smallest text the pair is good for under [decision 0014's thresholds](https://meadowstack.com/glossary/apca/): all text from Lc 75, text from 14px from Lc 60, text from 24px or from 16px at weight 550 from Lc 45, and no text below 4.5:1.

## How the token pairs are chosen

The token check pairs tokens by their names, so the same CSS always gives the same pairs:

- **shadcn/ui's names**: every `X-foreground` on `X`, and `foreground` and `muted-foreground` on `background`, `card`, `popover` and `muted`.
- **The kit's names**: `fg`, `fg-muted` and `fg-subtle` on `surface`, `canvas`, `frame` and `surface-subtle`; every `X-fg` on `X-subtle`, or on `X` when there is no `X-subtle`; every `X-contrast` on `X-solid`; `primary-fg` on `primary`.
- **Tailwind's prefix**: a leading `color-` is ignored when names are matched, so `--color-primary-foreground` pairs as well.

A pair the names cannot show, a link colour on a card for one, can be added by hand under the field.

## What the token check reads

- **Blocks**: `:root` and Tailwind's `@theme` are the light theme; `.dark`, `[data-theme="dark"]` or `:root` inside `@media (prefers-color-scheme: dark)` the dark one. A token the dark block leaves out keeps its light value, as it does in the browser.
- **Colours**: hex, `rgb()`, `hsl()`, `oklch()`, shadcn/ui's bare HSL numbers and `light-dark()`, with every `var()` followed to its end.
- **Transparency**: a translucent text colour is blended over its background, the way the browser draws it. A translucent background is skipped, because what shows through it is not in the CSS.
- **Skipped**: a value it cannot read, such as `color-mix()` or `lab()`, is listed under its theme's table with the reason, and the pairs that need it are left out. Nothing is guessed.

## What it does not check

Both tools read colours, not screens: the checker takes its two colours as opaque, and neither sees a picture or a gradient behind the text. A font's real weight and how the screen draws it change what people see too, so check the screen itself as well.

## Check your colour tokens

*Every text token on its backgrounds in each theme, the weakest first, starting with Meadowstack's own semantic colours and computed with the checker's code.*

An interactive tool that runs in the browser on the page: https://meadowstack.com/tools/apca-contrast-checker/

## Questions

### Which colour formats does it read?

The checker reads hex, as #RGB or #RRGGBB, and CSS oklch(), the format the kit's colour tokens are written in. The token check also reads rgb(), hsl(), shadcn/ui's bare HSL numbers and var().

### Why does it show two numbers?

WCAG 2.2's ratio is what most audits still test against, and APCA's Lc is read against the size and weight of the text. Meadowstack's rule needs both: the Lc for the text size, and never less than 4.5:1.

### Can I paste shadcn/ui's globals.css?

Yes, in both its forms: the older one with bare HSL numbers inside @layer base, and the Tailwind 4 one with oklch() and @theme inline, whose --color- lines only point back at the tokens. Every foreground token is measured on its background in the light and the dark theme.

### Why is a pair missing or skipped?

Pairs come from the token names, so a token named outside shadcn/ui's or the kit's patterns pairs with nothing until you add it by hand. A token is skipped when its value does not come out as one flat colour, such as color-mix(), a var() that points nowhere or a translucent background, and the list under each table says which and why.

### Is anything sent to a server?

No. Both tools are scripts on this page; the colours and the CSS you paste never leave your browser.

## Sources

- [APCA-W3 on GitHub (Myndex)](https://github.com/Myndex/apca-w3), checked 1 December 2026
- [WCAG 2.2, 1.4.3 Contrast (Minimum)](https://www.w3.org/TR/WCAG22/#contrast-minimum), checked 1 December 2026
- [shadcn/ui: Theming](https://ui.shadcn.com/docs/theming), checked 2 December 2026
- [shadcn/ui: Tailwind v4](https://ui.shadcn.com/docs/tailwind-v4), checked 2 December 2026

## Related

- [APCA](https://meadowstack.com/glossary/apca/) (Glossary)
- [Contrast ratio](https://meadowstack.com/glossary/contrast-ratio/) (Glossary)
- [Dark mode](https://meadowstack.com/glossary/dark-mode/) (Glossary)
- [Contrast in business apps: what an audit of our demo found, and how we fixed it](https://meadowstack.com/blog/contrast-in-business-apps/) (Blog)
- [Notice: messages by importance, in one frame](https://meadowstack.com/components/notice/) (Components)
- [StatusLabel: a status as a glyph and a word](https://meadowstack.com/components/status-label/) (Components)
