Skip to content
This repository has been archived by the owner on May 28, 2024. It is now read-only.

akshat1/simian-color-functions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simian-color-functions

Color functions. I use them with PostCSS using the excellent postcss-functions plugin, but these can be used anywhere one needs to lighten or darken color values.

API:

const ColorFunctions = require('simian-color-functions');

ColorFunctions.lighten('black', '50%');               // -> 'grey'
ColorFunctions.lighten('#000000', '0.5');             // -> '#808080'
ColorFunctions.lighten('rgb(0, 0, 0)', '50%');        // -> 'rgba(128, 128, 128)'
ColorFunctions.lighten('rgba(0, 0, 0, 0.7)', '50%');  // -> 'rgba(128, 128, 128, 0.7)'

ColorFunctions.darken('white', '50%');                // -> 'grey'
ColorFunctions.darken('black', '50%');                // -> 'black'

To see detailed documentation, just run the default gulp task which will also generate the jsdoc.

About

Color functions I use with PostCSS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published