simple-color-contrast-calculator
v1.0.4
Published
Simple Color Contrast Calculator
Downloads
3
Maintainers
Readme
Simple Color Contrast Calculator
Simple color contrast calculator, given two colors it returns the contrast. Accepts either Hex code (must start with #) or RGB array.
Installation
npm i simple-color-contrast-calculator
Example usage
import contrast from "simple-color-contrast-calculator"
console.log(contrast("#FFFFFF","#000000"))
// 21
console.log(contrast([255,255,255],[0,0,0]))
// 21
const contrast = require('simple-color-contrast-calculator');
console.log(contrast("#FFFFFF","#000000"))
// 21
console.log(contrast([255,255,255],[0,0,0]))
// 21
Licence
MIT