|
|
3 년 전 | |
|---|---|---|
| .. | ||
| lib | 3 년 전 | |
| CHANGELOG.md | 3 년 전 | |
| LICENSE.md | 3 년 전 | |
| README.md | 3 년 전 | |
| index.bundle.js | 3 년 전 | |
| index.js | 3 년 전 | |
| package.json | 3 년 전 | |
Convert Colors converts colors between RGB, HSL, HWB, Lab, LCH, HSV, and XYZ.
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
Add Convert Colors to your build tool:
npm install @csstools/convert-colors --save-dev
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.