1.0.1 • Published 1 year ago

shade-hex v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

shade-hex

shadeHex(color, value);

Returns a brightened or darkened hex string.

Npm package

Github repo

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