@ant-design/fast-color
Fast Color Class
Install
Usage
import { FastColor } from '@ant-design/fast-color';
new FastColor('#666');
new FastColor('#66ccff');
new FastColor('#66ccffaa');
new FastColor('rgba(102, 204, 255, .5)');
new FastColor('rgb(102 204 255 / .5)');
new FastColor('hsl(270, 60, 40, .5)');
new FastColor('hsl(270deg 60% 40% / 50%)');
new FastColor({ r: 102, g: 204, b: 255, a: 0.5 });
new FastColor({ h: 270, s: 0.6, l: 0.4, a: 0.5 });
new FastColor({ h: 270, s: 0.6, v: 0.4, a: 0.5 });
const color = new FastColor('#66ccff');
const color2 = new FastColor(color);
const color3 = color2.clone();
color.toHexString();
color.toRgb();
color.toRgbString();
color.toHsl();
color.toHslString();
color.toHsv();
Compatibility
IE / Edge | Firefox | Chrome | Safari | Electron |
---|
IE11, Edge | last 2 versions | last 2 versions | last 2 versions | last 2 versions |
API
TODO
License
@ant-design/fast-color is released under the MIT license.