0.2.0 • Published 5 years ago

@sadbox/color-utils v0.2.0

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

Version License Dependencies Bundle Size Build Status

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)