1.0.1 • Published 1 year ago
shade-hex v1.0.1
shade-hex
shadeHex(color, value);
Returns a brightened or darkened hex string.
Installation
npm install shade-hex
Usage
import shadeHex from "shade-hex";
- Inputs -
color
- A color value '#XXXXXX' or 'XXXXXX'.
value
- Amount you want to brighten or darken the color.
- Outputs -
Will return a brightened or darkened shade of the input color.
Ex:
console.log(shadeHex("#d50000", 2);
---> // '#f72222'
console.log(shadeHex("#d50000", -2);
---> // '#b30000'
console.log(shadeHex("212121", 3);
---> // '#545454'
Thanks for reading! Check out my portfolio at derekmason.dev