contrast
Determine if the given color is light or dark.
This is useful for dynamically deciding which color a foreground color should be when placed over a given background color.
Install
npm install contrast --save
Usage
var contrast = ; var el = document;var bgColor = estylebackgroundColor; if === 'light' textColor = '#000';else textColor = '#fff' elstylecolor = textColor;
Run Tests
npm install
npm test