* @since 5.5
*/
getColor(source) {
- const a = parseFloat(this.channels.get("a" /* A */).value);
- if (source === "hsl" /* HSL */) {
- const rgb = ColorUtil.hslToRgb(parseInt(this.hsl.get("hue" /* Hue */).value, 10), parseInt(this.hsl.get("saturation" /* Saturation */).value, 10), parseInt(this.hsl.get("lightness" /* Lightness */).value, 10));
+ const a = parseFloat(this.channels.get("a" /* Channel.A */).value);
+ if (source === "hsl" /* ColorSource.HSL */) {
+ const rgb = ColorUtil.hslToRgb(parseInt(this.hsl.get("hue" /* HSL.Hue */).value, 10), parseInt(this.hsl.get("saturation" /* HSL.Saturation */).value, 10), parseInt(this.hsl.get("lightness" /* HSL.Lightness */).value, 10));
- return Object.assign(Object.assign({}, rgb), { a });
+ return {
+ ...rgb,
+ a,
+ };
}
return {
- r: parseInt(this.channels.get("r" /* R */).value, 10),
- g: parseInt(this.channels.get("g" /* G */).value, 10),
- b: parseInt(this.channels.get("b" /* B */).value, 10),
+ r: parseInt(this.channels.get("r" /* Channel.R */).value, 10),
+ g: parseInt(this.channels.get("g" /* Channel.G */).value, 10),
+ b: parseInt(this.channels.get("b" /* Channel.B */).value, 10),
a,
};
}