From: Tim Düsterhus Date: Tue, 31 May 2022 10:00:16 +0000 (+0200) Subject: Merge branch '5.5' X-Git-Tag: 6.0.0_Alpha_1~1236 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c73470efd4d703a6e0d006f7bb465077add83a1c;p=GitHub%2FWoltLab%2FWCF.git Merge branch '5.5' --- c73470efd4d703a6e0d006f7bb465077add83a1c diff --cc wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Color/Picker.js index 08abd62ce3,e9f7397fe6..0bc7eef5c6 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Color/Picker.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Color/Picker.js @@@ -153,10 -185,18 +185,21 @@@ define(["require", "exports", "tslib", * * @since 5.5 */ - getColor() { - const color = this.colorInput.value; - const alpha = this.alphaInput.value; - return { ...ColorUtil.hexToRgb(color), a: +alpha }; + 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)); - 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), + a, + }; } /** * Opens the color picker after clicking on the picker button.