/color-functions

color functions for node and browser

Primary LanguageJavaScriptMIT LicenseMIT

color-functions

Build Status codecov.io

color functions for node and browser (browserify)

Installation

npm install color-functions --save

Usage

// import all functions
var cf = require('color-functions');
var hex2rgb = cf.hex2rgb;

// import single function
// (to reduce bundle script size with browserify or webpack)
var hex2rgb = require('color-functions/lib/hex2rgb');
var cssColor = require('color-functions/lib/css-color');

Available functions

  • hex2rgb
  • hsv2hex
  • hsv2rgb
  • rgb2hex
  • rgb2hsv
  • rgba
  • hsl2hsv
  • hsv2hsl
  • hsl2rgb
  • rgba2rgb
  • rgba2hex
  • cssColor: parse a valid css color value to rgba format

License

MIT