Get relative luminance
get-relative-luminance
calculates a CSS color's relative luminance based on
this definition from W3C.
It doesn't handle transparency as of yet.
Installation
$ npm install get-relative-luminance
Usage
; ; // 1; // 1; // 0
Signature
(color: string, { ignoreTransparency:boolean = false } = {}) => number
Contributing
I appreciate your issues and PRs on Github!
Testing
yarn build && yarn test
Releasing
This project uses np.
- Make sure your changes are in master
- Run
yarn release
- Follow the interactive release guide