Check contrast of colors HEX
npm install color-manipulation-utilsbash
npm install color-manipulation-utils
``
$3
``bash
yarn install color-manipulation-utils
``
$3
``bash
pnpm add color-manipulation-utils
``
Usage
$3
Import the darken function from color-manipulation-utils:
``typescript
import { darken } from 'color-manipulation-utils';
``
or
``typescript
import darken from 'color-manipulation-utils/darken';
``
Darken a color:
``typescript
const darkenedColor = darken('#7a0f0f', 0.2);
console.log(darkenedColor); // Outputs a darkened color in hex format
``
$3
Import the lighten function from color-manipulation-utils:
``typescript
import { lighten } from 'color-manipulation-utils';
``
Or
``typescript
import lighten from 'color-manipulation-utils/lighten';
``
Lighten a color:
``typescript
const lightenedColor = lighten('#068806', 0.2);
console.log(lightenedColor); // Outputs a lightened color in hex format
```