npm.io
3.0.1 • Published 7 years ago

color-functions

Licence
MIT
Version
3.0.1
Deps
0
Size
34 kB
Vulns
0
Weekly
0
Stars
10
DeprecatedThis package is deprecated

color-functions

npm npm Build Status codecov styled with prettier Greenkeeper badge

Color functions for node and browser (via browserify, webpack, ...)

Installation

npm install color-functions --save
# or
yarn add color-functions

Usage

// commonjs
const { hex2rgb } = require('color-functions');

// es module
import { hex2rgb, cssColor } from 'color-functions';
import * as cf from 'color-functions';
Available functions
  • cssColor: parse a valid css color value to rgba format
  • hex2hsl
  • hex2rgb
  • hsl2hsv
  • hsl2rgb
  • hsv2hex
  • hsv2hsl
  • hsv2rgb
  • rgb2hex
  • rgb2hsv
  • rgba
  • rgba2hex
  • rgba2rgb

check test for more examples

License

MIT

Keywords