Package Exports
- color-functions
- color-functions/dist/css-color
- color-functions/dist/hex2rgb
- color-functions/dist/hsv2hex
- color-functions/dist/hsv2rgb
- color-functions/dist/rgb2hex
- color-functions/dist/rgb2hsv
- color-functions/dist/rgba
- color-functions/dist/rgba2hex
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (color-functions) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
color-functions
Color functions for node and browser (via browserify
, webpack
, ...)
Installation
npm install color-functions --save
# or
yarn add color-functions
Usage
// import all functions
const cf = require('color-functions');
const hex2rgb = cf.hex2rgb;
// import single function
// to reduce bundle size with browserify or webpack
const hex2rgb = require('color-functions/dist/hex2rgb');
const cssColor = require('color-functions/dist/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