Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
C

contrast-ratio

> 编程语言
Open source

A tool to calculate the contrast ratio between any two valid CSS colors.

2.4K stars0 likes0 views
WebsiteGitHub

About

A tool to calculate the contrast ratio between any two valid CSS colors.

Contrast Ratio

Official version

A tool to calculate the WCAG (Web Content Accessibility Guidelines) contrast ratio of text on a web page.

WCAG define two levels of compliance that differ only in the contrast ratio:

Level AA:

  • 4.5:1 for normal text
  • 3:1 for large text
  • 3:1 for graphics and user interface components (such as form input borders) Level AAA:
  • 7:1 for normal text
  • 4.5:1 for large text

Large text is defined as 14 point (typically 18.66px, or 1.2rem when the root font is 16px) and bold or larger, or 18 point (typically 24px or 1.5rem) or larger.

NOTE: this repo does not create the public website any longer. The code is used as the basis for the page at Siege Media.

Acknowledgements

  • Lea Verou for initial concept and programming
  • Seth Falco

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

JavaScript

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言