CONTRAST CHECK

颜色对比度检查,配色更无障碍。

输入前景色与背景色,按 WCAG 标准算出对比度比值,并判定普通文字、大号文字的 AA / AAA 是否达标,附实时样例。纯前端本地处理。

—
Aa 示例文字 Sample Text

对比度怎么算?

WCAG 用相对亮度算对比度:(L1+0.05)/(L2+0.05)。普通文字需 ≥4.5(AA)、≥7(AAA);大号文字(≥18pt 或 14pt 加粗)需 ≥3(AA)、≥4.5(AAA)。配色不达标会影响可读性,尤其对视力不佳者。

示例与注意事项Example & notes

一个例子A worked example

把正文色 #8B98AD 与背景 #080D1D 放进去,得到对比度约 6.1:1,满足 WCAG AA 的正文要求。Feed in text #8B98AD on background #080D1D: the ratio is about 6.1:1, which passes WCAG AA for body text.

注意事项Things to watch

相关问答More Q&A

为什么黑白比值正好是 21:1?Why is black-on-white exactly 21:1?

这是 WCAG 对比度公式推导出的理论上限:(1.05) / (0.05) = 21。It is the theoretical ceiling of the WCAG formula: (1.05) / (0.05) = 21.

能一次检查整套配色吗?Can I check a whole palette?

可逐组检查常用搭配;页面还提供明度扫描,直接给出达标区间与建议明度。Check pairs one by one; the page also sweeps lightness to show the passing range and a suggested value.

深入阅读

觉得好用?Found it useful?