0.1.1 • Published 7 years ago
colornary v0.1.1
$ npm install --save colornary
<script src="modules/colornary.js"></script>
const myRgbColor = toRgb('#fff');
// => `rgb(255, 255, 255)`
const myRgbaColor = toRgba('hsla(0, 0%, 100%, 0.5)');
// => `rgb(255, 255, 255, 0.5)`
const myHexColor = toHex('hsl(195, 100%, 50%)');
// => `#00bfff`
const myHslColor = toHsl('#ff00ff');
// => `hsl(300, 100%, 50%)`
const myHslaColor = toHsla('rgba(128, 0, 128, .75)');
// => `hsla(300,100%,25%,1)`
const myLighterColor = lighten('rgb(0, 0, 0)');
// => `rgb(26, 26, 26)`
const myDarkerColor = darken('rgb(255, 255, 255)', 0.5);
// => `rgb(128, 128, 128)`
const mySaturatedColor = saturate('rgb(13, 13, 13)');
// => `rgb(14, 11, 11)`
const myDesaturatedColor = desaturate('hsla(10, 10%, 0%, 1)');
// => `hsla(10, 0%, 0%)`
const myOpacifiedColor = opacify('rgba(255,255,255,0.5)', 0.2);
// => `rgba(255,255,255,0.7)`
const myTransparentizedColor = transparentize('rgba(255,255,255,0.5)', 0.2);
// => `'rgba(255,255,255,0.3)'`