@sadbox/color-utils
v0.2.0
Published
A set of utility functions for working with colors
Downloads
5
Readme
Color Utils
A lightweight set of utility functions for working with colors.
Supported color formats: #000
, #0000
, #000000
, #00000000
, rgb()
, rgba()
, hsl
, hsla()
Install
yarn add @sadbox/color-utils
or
npm install -S @sadbox/color-utils
Usage
import { darken } from '@sadbox/color-utils';
const dark = darken('#fff', 0.5); // #808080
Available Utils
darken(color, coefficient)
lighten(color, coefficient)
getLuminance(color)
setAlpha(color, alpha)