Color functions for node and browser
npm install @swiftcarrot/color-fns --save
yarn add @swiftcarrot/color-fns
// commonjs
const { hex2rgb } = require('@swiftcarrot/color-fns');
// es module
import { hex2rgb, cssColor } from '@swiftcarrot/color-fns';
import * as fns from '@swiftcarrot/color-fns';
cssColor
: parse a valid css color value to rgba formathex2hsl
hex2hsv
hex2rgb
hsl2hsv
hsl2rgb
hsv2hex
hsv2hsl
hsv2rgb
rgb2hex
rgb2hsv
rgba
rgba2hex
rgba2rgb
check test for more examples
MIT