See https://www.woltlab.com/community/thread/302477-stil-editor-bei-ung%C3%BCltiger-farbe-fehlermeldung/
*/
protected submitDialog(): void {
const color = this.getColor(ColorSource.RGBA);
+ const hasNanValue = Object.values(color).some((value) => Number.isNaN(value));
+ if (hasNanValue) {
+ // Prevent the submission of invalid color values.
+ return;
+ }
+
const colorString = ColorUtil.rgbaToString(color);
this.oldColor!.style.backgroundColor = colorString;
*/
submitDialog() {
const color = this.getColor("rgba" /* ColorSource.RGBA */);
+ const hasNanValue = Object.values(color).some((value) => Number.isNaN(value));
+ if (hasNanValue) {
+ // Prevent the submission of invalid color values.
+ return;
+ }
const colorString = ColorUtil.rgbaToString(color);
this.oldColor.style.backgroundColor = colorString;
this.input.value = colorString;