Package Exports
- @csstools/convert-colors
- @csstools/convert-colors/index.js
- @csstools/convert-colors/index.mjs
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 (@csstools/convert-colors) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Convert Colors 
Convert Colors converts colors between RGB, HEX, HSL, HWB, LAB, LCH, and more.
import convert from '@csstools/convert-colors';
convert.rgb2hsl(100, 100, 100); // [ 0, 0, 100 ]
convert.rgb2hwb(100, 100, 100); // [ 0, 100, 0 ]
convert.hsl2rgb(0, 0, 100); // [ 0, 100, 0 ]
convert.hsl2hwb(0, 0, 100); // [ 0, 100, 0 ]
convert.hwb2rgb(0, 100, 0); // [ 0, 0, 100 ]
convert.hwb2hsl(0, 100, 0); // [ 0, 0, 100 ]
convert.rgb2hue(0, 0, 100); // 240
convert.rgb2contrast([100, 100, 100], [0, 0, 0]); // 21
convert.rgb2ciede2000([100, 100, 100], [0, 0, 0]); // 100Usage
Add Convert Colors to your build tool:
npm install @csstools/convert-colors --save-devFeatures
Conversions work by taking arguments that represents a color in one color space and returning an array of that same color in another color space.