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.
By Bohuslav PoláčekChecked
Hex (#1d1d1f) or OKLCH (oklch(0.45 0 0))
Hex (#1d1d1f) or OKLCH (oklch(0.45 0 0))
- APCA
- Lc 87.2
- WCAG 2
- 7.81:1
- Carries
- All text
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: 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-foregroundonX, andforegroundandmuted-foregroundonbackground,card,popoverandmuted. - The kit's names:
fg,fg-mutedandfg-subtleonsurface,canvas,frameandsurface-subtle; everyX-fgonX-subtle, or onXwhen there is noX-subtle; everyX-contrastonX-solid;primary-fgonprimary. - Tailwind's prefix: a leading
color-is ignored when names are matched, so--color-primary-foregroundpairs 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:
:rootand Tailwind's@themeare the light theme;.dark,[data-theme="dark"]or:rootinside@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 andlight-dark(), with everyvar()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()orlab(), 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
Your globals.css, or just its :root and dark blocks. It reads hex, rgb(), hsl(), oklch(), shadcn/ui's bare HSL numbers and var().
No custom properties to read. Paste the CSS where your colour tokens are defined.
Light theme
21 pairs: 3 carry no text under 14px.
| PairText token | Background | ContrastAPCA | WCAG 2 | Carries |
|---|---|---|---|---|
| fg-subtleon frameText from 14px | frame | Lc 72.55.12:1 | 5.12:1 | Text from 14px |
| fg-subtleon canvasText from 14px | canvas | Lc 74.15.25:1 | 5.25:1 | Text from 14px |
| fg-subtleon surface-subtleText from 14px | surface-subtle | Lc 74.55.28:1 | 5.28:1 | Text from 14px |
| danger-contraston danger-solidAll text | danger-solid | Lc −75.14.75:1 | 4.75:1 | All text |
| success-contraston success-solidAll text | success-solid | Lc −76.04.64:1 | 4.64:1 | All text |
| info-fgon info-subtleAll text | info-subtle | Lc 76.56.29:1 | 6.29:1 | All text |
| danger-fgon danger-subtleAll text | danger-subtle | Lc 76.76.74:1 | 6.74:1 | All text |
| info-contraston info-solidAll text | info-solid | Lc −76.84.79:1 | 4.79:1 | All text |
| warning-fgon warning-subtleAll text | warning-subtle | Lc 77.26.24:1 | 6.24:1 | All text |
| fg-subtleon surfaceAll text | surface | Lc 77.55.51:1 | 5.51:1 | All text |
| warning-contraston warning-solidAll text | warning-solid | Lc 78.111.14:1 | 11.14:1 | All text |
| success-fgon success-subtleAll text | success-subtle | Lc 81.27.36:1 | 7.36:1 | All text |
| fg-mutedon frameAll text | frame | Lc 82.07.23:1 | 7.23:1 | All text |
| fg-mutedon canvasAll text | canvas | Lc 83.67.40:1 | 7.40:1 | All text |
| fg-mutedon surface-subtleAll text | surface-subtle | Lc 84.07.44:1 | 7.44:1 | All text |
| fg-mutedon surfaceAll text | surface | Lc 87.07.77:1 | 7.77:1 | All text |
| fgon frameAll text | frame | Lc 98.615.51:1 | 15.51:1 | All text |
| fgon canvasAll text | canvas | Lc 100.215.88:1 | 15.88:1 | All text |
| fgon surface-subtleAll text | surface-subtle | Lc 100.615.97:1 | 15.97:1 | All text |
| fgon surfaceAll text | surface | Lc 103.616.67:1 | 16.67:1 | All text |
| primary-fgon primaryAll text | primary | Lc −103.816.20:1 | 16.20:1 | All text |
Skipped
Dark theme
21 pairs: 4 carry no text under 14px.
| PairText token | Background | ContrastAPCA | WCAG 2 | Carries |
|---|---|---|---|---|
| fg-subtleon surfaceText from 14px | surface | Lc −62.99.31:1 | 9.31:1 | Text from 14px |
| fg-subtleon surface-subtleText from 14px | surface-subtle | Lc −63.29.55:1 | 9.55:1 | Text from 14px |
| fg-subtleon canvasText from 14px | canvas | Lc −63.39.76:1 | 9.76:1 | Text from 14px |
| fg-subtleon frameText from 14px | frame | Lc −63.510.05:1 | 10.05:1 | Text from 14px |
| danger-contraston danger-solidAll text | danger-solid | Lc −75.14.72:1 | 4.72:1 | All text |
| danger-fgon danger-subtleAll text | danger-subtle | Lc −75.29.99:1 | 9.99:1 | All text |
| success-fgon success-subtleAll text | success-subtle | Lc −76.010.07:1 | 10.07:1 | All text |
| info-contraston info-solidAll text | info-solid | Lc 76.111.78:1 | 11.78:1 | All text |
| info-fgon info-subtleAll text | info-subtle | Lc −76.410.02:1 | 10.02:1 | All text |
| warning-fgon warning-subtleAll text | warning-subtle | Lc −76.59.82:1 | 9.82:1 | All text |
| warning-contraston warning-solidAll text | warning-solid | Lc 76.811.24:1 | 11.24:1 | All text |
| success-contraston success-solidAll text | success-solid | Lc 77.412.00:1 | 12.00:1 | All text |
| fg-mutedon surfaceAll text | surface | Lc −77.912.18:1 | 12.18:1 | All text |
| fg-mutedon surface-subtleAll text | surface-subtle | Lc −78.112.49:1 | 12.49:1 | All text |
| fg-mutedon canvasAll text | canvas | Lc −78.312.77:1 | 12.77:1 | All text |
| fg-mutedon frameAll text | frame | Lc −78.513.14:1 | 13.14:1 | All text |
| primary-fgon primaryAll text | primary | Lc 94.315.87:1 | 15.87:1 | All text |
| fgon surfaceAll text | surface | Lc −95.315.87:1 | 15.87:1 | All text |
| fgon surface-subtleAll text | surface-subtle | Lc −95.516.28:1 | 16.28:1 | All text |
| fgon canvasAll text | canvas | Lc −95.716.64:1 | 16.64:1 | All text |
| fgon frameAll text | frame | Lc −95.817.13:1 | 17.13:1 | All text |
Skipped
Sources
- APCA-W3 on GitHub (Myndex)Checked
- WCAG 2.2, 1.4.3 Contrast (Minimum)Checked
- shadcn/ui: ThemingChecked
- shadcn/ui: Tailwind v4Checked
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.
Two ways
Build it yourself, or have it built
Build it yourself
Build your app on the framework
Get the codebase these apps stand on and build yours with Claude Code, Cursor or Codex.
One payment, lifetime updates
Get the frameworkHave it built
Have us build your app
Tell us how your team works. We plan the app with you and build it on the same framework at a fixed price.
After launch, Care keeps it improving, from €99 a month.
from €1,990
Describe your app