simple-color-functions
v0.5.1
Published
A set of simple color functions.
Downloads
1,707
Maintainers
Readme
Simple color functions
Javascript library with a set of functions of manipulation and color conversion.
Installation
npm install simple-color-functions --save-dev
or
yarn add -D simple-color-functions
Usage
Several examples of color manipulation
colors('#23bc98').brighten(1.2).hex(); // #71fad3
colors('#23bc98').darken(0.5).hex(); // #00a381
colors('#23bc98').css(); // rgb(35,188,152)
colors('#23bc98').alpha(.5).css(); // rgba(35,188,152.5)
colors('#23bc98').brightness('-20%').hex(); // #009675
colors('#23bc98').brightness(-0.2).hex(); // #009675
colors('#fff').contrast('#23bc98'); // 2.3348071108457673
colors('#23bc98').luminance(); // 0.39971595089054046