A utility to check for WCAG compliant color contrast
Last updated a year ago by ajberkow .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @ajberkow/color-contrast 
SYNC missed versions from official npm registry.


============== A small utility to calculate color contrast and determine WCAG compliance. This tool is based on the WebAIM color contrast checker. It uses calculations based on the W3C Web Content Accessibility Guidelines.

oclif Version Downloads/week License




Commands take the format color-contrast [-f <foreground hex value>] [-b <background hex value>]. Foreground and background values can be entered with or without # signs. The default values are

  • foreground: #000000
  • background: #ffffff

A report is generated for each ratio. For example, entering this command color-contrast -f #123abc returns

	"ratio": 8.909214716654146,
	"AA": "pass",
	"AALarge": "pass",
	"AAA": "pass",
	"AAALarge": "pass"


  • Tests
  • Other kinds of color formatting (e.g. rgb, hsl) and possibly transparency

Current Tags

  • 0.0.1                                ...           latest (a year ago)

1 Versions

  • 0.0.1                                ...           a year ago
Maintainers (1)
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (3)
Dev Dependencies (4)
Dependents (0)

Copyright 2014 - 2016 © taobao.org |