Skip to content

msecret/wcag-contrast-verifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wcag-contrast-verifier

Build Status

Check that two colors are wcag AA and AAA compliant.

Getting Started

Install the module with: npm install wcag-contrast-verifier

var verify = require('wcag-constrast-verifier').verify;

var result = verify('#ffffff', '#aa3177', 22);
// -> {WCAG_AA: true|false, WCAG_AAA: true|false}
var result = verify(
  {r: 255, g: 100, b: 150},
  {r: 50, g: 100, b: 150},
  12
);
// -> {WCAG_AA: true|false, WCAG_AAA: true|false}

Documentation

Verify
Params:

  • color 1 {Object | String} : A color in the form of a object with separate r, g, b int 255 values or a hex code string prefaced with a hash (#).
  • color 2 {Object | String} : A color in the form of a object with separate r, g, b int 255 values or a hex code string prefaced with a hash (#).
  • font size {Number} : A int value of the font size.

Examples

(Coming soon)

Release History

(Nothing yet)

Contributers

Marco Segreto
Victoria Nguyen

License

Copyright (c) 2014 Marco Secreto Licensed under the Public Domain.

About

Checks that two colors are section 508 compliant

Resources

License

Stars

Watchers

Forks

Packages

No packages published