@alchemyalcove/color-calculator
v1.0.3
Published
Ether Color Calculator
Downloads
8
Readme
AlchemyAlcove Color Calculator
ColorCalculator is color manipulation library.
2KB download size minified.
This project has two dependencies.
Install
npm install --save @alchemyalcove/color-calculator
Use
Color Calculator is chainable function library. Simple create a Color Calculator object and then run as many functions as you want. Finally, export back to a hex color with the toHex function.
import Color from "@alchemyalcove/color-calculator";
new Color("#2cf366").toHex();
// #2CF366
// Is a color light. Great for contrast comparison.
new Color("#666666").isLight();
// false
// Is a color dark.
new Color("#666666").isDark();
// true
// Lighten a color by 5%.
new Color("#2C3E50").lighten(5).toHex()
// #354A60
// Darken a color by 33%.
new Color("#FFF").darken(33).toHex()
// #AAAAAA
// Increase hue by 10%.
new Color("#2C3E50").increaseHue(10).toHex()
// #2F2C50
// Decrease hue by 10%.
new Color("#2C3E50").decreaseHue(10).toHex()
// #2C504C
// Increase saturation by 10%.
expect(new Color("#2C3E50").increaseSaturation(10).toHex()
// #253D56
// Decrease saturation by 10%.
expect(new Color("#2C3E50").decreaseSaturation(10).toHex()
// #323D49