JSPM

contrast

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 9687
  • Score
    100M100P100Q117000F
  • License MIT

Determine if the given color is light or dark

Package Exports

  • contrast

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (contrast) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

contrast

Determine if the given color is light or dark

Install

npm install contrast --save

Usage

var contrast = require('contrast');

console.log(contrast('000000')); // OUTPUTS: dark
console.log(contrast('#ffffff')); // OUTPUTS: light

Run Tests

npm install
npm test