對比度檢查器

檢查文字色和背景色是否符合 WCAG AA 和 AAA,並找出最接近且能通過的顏色。

Result

Large text at 24px looks like this

Body text at 16px is where contrast matters most. Long paragraphs in low contrast tire the eyes quickly, especially on phones outdoors.

Small print at 14px — captions, labels and footnotes.

3.82:1

Large text and UI only. Normal text needs 4.5:1.

  • Normal text AA Fail AAA Fail
  • Large text AA Pass AAA Fail
  • UI components AA Pass
Text color
Background color
Target level
Marked band: lightness that reaches 4.5:1

Closest passing colors

Fails 4.5:1

Only lightness changes, so hue and saturation stay the same.

  • Aa Adjust text color #6B7A99 → #606E8D · 4.52:1
  • Aa Adjust background #F4F1EA → #0F0D09 · 4.50:1

WCAG levels by use

UseAAAAA
Normal textBelow 24px, or below 18.66px boldFail 4.5:1Fail 7:1
Large text24px and up, or 18.66px bold and upPass 3:1Fail 4.5:1
UI componentsIcons, borders, focus rings, input outlinesPass 3:1—

對比度如何計算

對比度比較兩個顏色的相對亮度,範圍從 1:1(完全相同)到 21:1(白底黑字)。網頁內容無障礙指引(WCAG 2)用它來判斷文字對低視能或色覺障礙的人是否好讀,在昏暗或反光的螢幕上是否看得清楚。色相不列入計算,只看兩個顏色有多亮或多暗。

WCAG AA 與 AAA 標準

  • 一般文字:AA 至少 4.5:1,AAA 至少 7:1。
  • 大字(24px 以上,或粗體 18.66px 以上):AA 為 3:1,AAA 為 4.5:1。
  • UI 元件與圖形,例如圖示、輸入框邊框和焦點框:3:1(WCAG 1.4.11)。

對比度會無條件捨去到小數點後兩位,所以 4.499:1 會顯示為 4.49:1,並判定為未通過 AA,和嚴格的檢測工具處理方式一樣。

修正未通過的組合

組合未通過時,檢查器會只改變 OKLCH 的明度,分別為文字和背景找出最接近、能通過的顏色。色相和飽和度維持不變,所以修正後看起來依然是你的品牌色。網址列中的連結可以分享這組確切的顏色。想要文字、背景和強調色角色都已經平衡好對比度的完整配色,請試試配色產生器,或瀏覽所有配色。