Visual design · Step 3 · 10 min read
Contrast ratios and WCAG
The two contrast measurement systems designers use today: the WCAG 2 contrast ratio (the current standard) and APCA Lc (the more perceptually accurate algorithm under development for WCAG 3). How to measure, what the thresholds mean, and how to verify Gale's palette in code.
Contrast is not opinion — it is mathematics. This lesson shows the two measurement systems the industry uses.
What you'll be able to do after reading:
- Calculate or verify a WCAG 2 contrast ratio using a tool
- Explain what WCAG AA and AAA mean and when each applies
- Describe what APCA Lc measures and how it differs from the WCAG 2 ratio
- State the current status of APCA in the standards process
- Verify Gale Blue's contrast against white and dark surfaces
1. The WCAG 2 contrast ratio
A contrast ratio (razão de contraste) is the quotient between the relative luminances of two colours. Relative luminance is a number from 0 (black) to 1 (white) that describes how much light a surface reflects. The formula is:
contrast ratio = (L1 + 0.05) / (L2 + 0.05)
where L1 is the lighter of the two relative luminances and L2 is the darker one. The result is always ≥ 1:1. Pure black on pure white gives 21:1.
Important: relative luminance in WCAG 2 is not the same as the L value in OKLCH. OKLCH L is a perceptual estimate from 0 to 1 that varies by colour space. WCAG 2 relative luminance is a specific calculation from linear RGB values, defined in the WCAG 2 spec (W3C, Understanding WCAG 2.2). You cannot substitute one for the other. To get the WCAG contrast ratio between two OKLCH colours, you need to convert them to relative luminance first — which is what contrast checker tools do for you.
| Sample | Ratio | WCAG AA ≥ 4.5:1 normal / ≥ 3:1 large |
|---|---|---|
|
Body text on white
|
15.3:1 | AAA |
|
Gale Blue on white
|
4.6:1 | AA |
|
White on Gale Blue
|
4.6:1 | AA |
|
Secondary text on white
|
7.0:1 | AAA |
|
Disabled text on white
|
3.5:1 | Fail (normal) |
|
Light text on Ops dark
|
9.1:1 | AAA |
WCAG 2 contrast ratio = (L1 + 0.05) ÷ (L2 + 0.05), where L is relative luminance (not the OKLCH L). "Normal text" ≤ 18pt/24px or ≤ 14pt/18.67px bold. The disabled text row fails AA for normal text — intentional; disabled elements are exempt from contrast requirements in WCAG 2.2 (SC 1.4.3). Gale Blue passes AA but not AAA (requires 7:1). Values are approximate.
2. WCAG levels: AA and AAA
WCAG 2 (Web Content Accessibility Guidelines) sets three levels: A, AA and AAA. Level AA is the legal minimum in most jurisdictions. Level AAA is the highest level — desirable when possible, but WCAG notes that "it is not possible to satisfy all Level AAA Success Criteria for some content" (WCAG 2.2 Introduction).
For colour contrast, the thresholds depend on text size and weight:
| Text type | AA | AAA |
|---|---|---|
| Normal text (< 18pt / 24px or < 14pt bold / ~19px bold) | 4.5:1 | 7:1 |
| Large text (≥ 18pt / 24px or ≥ 14pt bold / ~19px bold) | 3:1 | 4.5:1 |
| Non-text UI components and graphics | 3:1 | — |
Gale Console uses 12px as its minimum text size in table cells. 12px is well below 18pt, so the normal text threshold (4.5:1) applies throughout the interface.
Gale Blue on white: oklch(0.52 0.16 240) on oklch(0.99 0 0) gives a contrast ratio of approximately 4.84:1. It passes AA for normal text, narrowly. If Gale Blue were used as link text in body copy (also normal text), it would just clear the threshold. If it were used in 11px table cell labels — the smallest size in Gale's scale — it passes AA but not AAA (which requires 7:1).
Non-text contrast (SC 1.4.11). Buttons, input borders, focus indicators and chart lines must all meet 3:1 against their adjacent background. The border of an input at oklch(0.88 0.015 240) against a surface at oklch(0.97 0.01 240) gives about 1.6:1 — it fails SC 1.4.11. The fix is to darken the border to at least N40 (oklch(0.60 0.02 240), which gives about 3.5:1 against white).
3. APCA and Lc
The WCAG 2 contrast ratio has known limitations. Yellow text at 4.5:1 on a white background passes AA but reads poorly in practice. Thin text at 4.5:1 is harder to read than bold text at the same ratio. The formula was designed for a specific luminance model and misses some real-world cases.
APCA (Accessible Perceptual Contrast Algorithm) is a more perceptually accurate contrast algorithm. It was developed by Andrew Somers and corrects for text size, weight and polarity (light-on-dark vs. dark-on-light). The output is a value called Lc (lightness contrast), on a scale of roughly –110 to +106. Positive Lc means dark text on a light background; negative means light on dark.
APCA is currently under development for WCAG 3 (the next version of the guidelines). As of late 2026, WCAG 3 is a Working Draft — the W3C has stated it "still has several years of work" and that the contrast algorithm is "yet to be determined" (W3C, WCAG 3 Working Draft, 2026). APCA has not replaced WCAG 2.2. Using APCA alongside WCAG 2 for internal quality checks is reasonable practice; citing it as a legal or compliance requirement is not.
The two systems measure different things. The WCAG 2 contrast ratio measures the luminance quotient between two flat colours. The APCA Lc value accounts for the direction of contrast (which colour is text, which is background), font size and font weight. These are complementary measurements, not competing ones.
| System | Output | What it accounts for |
|---|---|---|
| WCAG 2 | Contrast ratio (e.g. 4.84:1) | Relative luminance of two colours |
| APCA | Lc value (e.g. Lc 60) | Luminance direction, text size, weight |
For Gale Blue (oklch(0.52 0.16 240)) on white at 14px regular weight, the APCA Lc value is approximately 60. APCA's draft guidance suggests Lc ≥ 60 for fluent reading of normal body text, Lc ≥ 45 for large text, Lc ≥ 75 for small text under 14px. These thresholds are provisional and may change before WCAG 3 is finalised.
4. How to measure in practice
For daily design work, use a contrast checker that shows both systems:
- WebAIM Contrast Checker — WCAG 2 ratios, AA/AAA pass/fail, quick to use
- APCA Contrast Calculator — APCA Lc, with Andrew Somers' guidance on thresholds
- Browser DevTools (Chrome / Edge / Firefox) — the accessibility tree shows the contrast ratio for selected text; Chrome DevTools shows both WCAG 2 and APCA since Chrome 118
In code, there is no stable CSS function for automatic contrast selection yet. The CSS Color 5 specification includes a function called contrast-color() (the name was updated from color-contrast() in a later draft) that would let you write contrast-color(var(--color-primary) max) to select the highest-contrast text colour. As of late 2026, this function remains in the CSS Color 5 Editor's Draft and is not supported in any shipping browser (CSS Color 5 Editor's Draft, 2026). For now, declare text colours explicitly.
5. What OKLCH L is not
OKLCH's L value is perceptually uniform — which means it tracks how light a colour looks to the eye. WCAG 2 relative luminance tracks how much light is physically emitted. The two are related but not identical. A quick comparison:
- Gale Blue
oklch(0.52 0.16 240)has OKLCH L = 0.52. - Its WCAG 2 relative luminance is approximately 0.167.
- Pure white has OKLCH L = 1.0 and WCAG relative luminance = 1.0.
- Gale Blue on white: contrast ratio = (1.0 + 0.05) / (0.167 + 0.05) ≈ 4.84.
The OKLCH L and the WCAG luminance are both "how bright does this look," but they use different models. For checking contrast, use the WCAG luminance calculation (which contrast tools do for you). For building a palette, OKLCH L is the right tool — it tells you whether the steps in your scale are perceptually even.
For a detailed look at how contrast appears in photographs and mixed media, see Measuring contrast on a photo. For the basics of contrast and colour perception, see Colour and contrast.
Step 3 is complete. In Step 4 we go to space: the spacing scale that goes from the smallest gap to the largest block.
6. Common mistakes
- Using OKLCH L as a proxy for WCAG contrast. L 0.52 and L 0.14 are not far enough apart to predict a contrast ratio. Use a contrast checker.
- Calling APCA "the new standard." APCA is a draft for WCAG 3. It is not a standard yet. Products must still meet WCAG 2.2 AA for legal compliance in most markets.
- Only checking text contrast. WCAG 2.2 SC 1.4.11 applies to non-text: input borders, icons, chart lines, focus rings. These need 3:1 against their adjacent background.
- Assuming large text gives more room. Large text ≥ 18pt (or ≥ 14pt bold) needs 3:1 for AA, not 4.5:1. But 18pt is 24px. Very few interfaces use headings at 24px with coloured text — most headings are dark on light. The threshold matters most for coloured headings and buttons with label text.
- Skipping dark mode contrast checks. Contrast ratios that pass in light mode may fail in dark mode. After defining your dark palette, run every text colour through the checker.
7. Vocabulary
| Term | Meaning |
|---|---|
| Contrast ratio (razão de contraste) | The quotient (L1 + 0.05) / (L2 + 0.05) between the relative luminances of two colours — the WCAG 2 measurement. Never just "contraste": always qualify which measurement system |
| Lc | The APCA contrast value, on a scale of roughly –110 to +106. Positive = dark text on light background. Never called "APCA contrast" — use "Lc" |
8. Try it
Use the contrast table in the figure above. It shows six text-on-background combinations from Gale's palette.
- Find the two rows that show Gale Blue as either text or button background. Both show 4.84:1. This is AA for normal text. How much would you need to lower Gale Blue's L to reach AAA (7:1)? Guess first, then check using WebAIM's Contrast Checker.
- Find "Disabled text on white" at 3.5:1. It fails AA for normal text. WCAG 2.2 SC 1.4.3 says disabled elements are exempt. But what if you wanted to meet AA anyway — what is the minimum L value for a cool-grey text on white to pass 4.5:1? Use the checker to find the value.
- Find "Light text on Ops dark" at 9.1:1. This is AAA. If the control-room team asked you to lower the dark surface from L 0.17 to L 0.22 (to make it less harsh), what would happen to the contrast ratio? Would it still pass AA?
You are done when you have three contrast ratio values: Gale Blue at AAA, minimum-AA disabled text, and the adjusted Ops dark surface.
9. If you already practise
- Run a WCAG 2 audit on a component you recently shipped. Check both text contrast and non-text contrast (SC 1.4.11). Which fails first?
- Read Andrew Somers' explanation of why the WCAG 2 formula fails for some edge cases: Myndex Research, Why WCAG 2 contrast fails. He wrote it as the motivation for APCA. Notice which specific failures (yellow text, reverse polarity, thin fonts) the WCAG 2 formula misses.
- The CSS Color 5 draft includes
contrast-color()(CSS Color 5 Editor's Draft). Read the syntax proposal, even though it is not in browsers yet. What would it let you do that you currently cannot?
Checklist
Learn more
- W3C, Understanding WCAG 2.2 — 1.4.3 Contrast (Minimum) — the official explanation of AA text contrast
- W3C, Understanding WCAG 2.2 — 1.4.11 Non-text Contrast — the threshold for UI components
- WebAIM Contrast Checker — the fastest tool for a WCAG 2 ratio check
- APCA Contrast Calculator — Lc values and Andrew Somers' draft guidance thresholds
- W3C, WCAG 3 Working Draft (2026) — current status of WCAG 3; the contrast algorithm is listed as "yet to be determined"
- CSS Color 5 Editor's Draft — contrast-color() — the draft CSS function for automatic contrast selection (not in browsers)
Books, courses and videos to go deeper
- Interaction of ColorJosef AlbersBook · Yale University Press, pocket edition, 2006 · — perception is the foundation: why the same grey looks different depending on its neighbours (Amazon)
- CSS in DepthKeith GrantBook · Manning, second edition, 2023 · — the CSS cascade and custom properties that make a token-based contrast system workable
Book links go to Amazon. As an Amazon Associate I earn from qualifying purchases, at no extra cost to you.
Related
Dark mode that actually works · Colour and contrast · Measuring contrast on a photo · Spacing scales