0.0.2 • Published 7 years ago

blackorwhite v0.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

blackorwhite

Get either black or white hex codes ('#000000' or '#ffffff'), depending on the background color for its optimal constrast, mostly for the purpose of legibility of the text on the background.

install

npm install --save blackorwhite

usage

import blackOrWhite from 'blackorwhite';

// later in the codes when using

const color = blackOrWhite.get('#9674cd');
console.log(color); // #ffffff

credits

The logic and many parts of the codes are stolen from this StackOverFlow answer/comments.

0.0.2

7 years ago

0.0.1

7 years ago