From d0829d52d77a5db762157fd1c9998349d964058f Mon Sep 17 00:00:00 2001 From: Jacob Welander Jensen <64834767+Welander1994@users.noreply.github.com> Date: Mon, 31 Mar 2025 14:19:06 +0200 Subject: [PATCH 1/2] add new check on alpha to check if undefined --- packages/uui-color-picker/lib/uui-color-picker.element.ts | 4 ++-- packages/uui-color-picker/lib/uui-color-picker.story.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/uui-color-picker/lib/uui-color-picker.element.ts b/packages/uui-color-picker/lib/uui-color-picker.element.ts index f97716da4..e9629792f 100644 --- a/packages/uui-color-picker/lib/uui-color-picker.element.ts +++ b/packages/uui-color-picker/lib/uui-color-picker.element.ts @@ -375,11 +375,12 @@ export class UUIColorPickerElement extends LabelMixin('label', LitElement) { const colord = new Colord(colorString); const { h, s, l, a } = colord.toHsl(); + console.log(colord.rgba, this.opacity); this.hue = h; this.saturation = s; this.lightness = l; - this.alpha = this.opacity ? a * 100 : 100; + this.alpha = this.opacity != undefined ? a * 100 : 100; const hslaColor = colorString as HslaColor; @@ -395,7 +396,6 @@ export class UUIColorPickerElement extends LabelMixin('label', LitElement) { this.dispatchEvent( new UUIColorPickerChangeEvent(UUIColorPickerChangeEvent.CHANGE), ); - return true; } diff --git a/packages/uui-color-picker/lib/uui-color-picker.story.ts b/packages/uui-color-picker/lib/uui-color-picker.story.ts index 50964b038..48336f6b5 100644 --- a/packages/uui-color-picker/lib/uui-color-picker.story.ts +++ b/packages/uui-color-picker/lib/uui-color-picker.story.ts @@ -73,6 +73,7 @@ export const Inline: Story = { export const Opacity: Story = { args: { opacity: true, + value: undefined, inline: true, }, }; From 6b70978bfd62a2e293adfef52ca2663b2b9032e4 Mon Sep 17 00:00:00 2001 From: Jacob Welander Jensen <64834767+Welander1994@users.noreply.github.com> Date: Tue, 1 Apr 2025 10:54:09 +0200 Subject: [PATCH 2/2] cleanup removing console.logs --- packages/uui-color-picker/lib/uui-color-picker.element.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/uui-color-picker/lib/uui-color-picker.element.ts b/packages/uui-color-picker/lib/uui-color-picker.element.ts index e9629792f..4de94086e 100644 --- a/packages/uui-color-picker/lib/uui-color-picker.element.ts +++ b/packages/uui-color-picker/lib/uui-color-picker.element.ts @@ -375,7 +375,6 @@ export class UUIColorPickerElement extends LabelMixin('label', LitElement) { const colord = new Colord(colorString); const { h, s, l, a } = colord.toHsl(); - console.log(colord.rgba, this.opacity); this.hue = h; this.saturation = s;