Skip to content

Commit d0829d5

Browse files
committed
add new check on alpha to check if undefined
1 parent 5408f29 commit d0829d5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

packages/uui-color-picker/lib/uui-color-picker.element.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,11 +375,12 @@ export class UUIColorPickerElement extends LabelMixin('label', LitElement) {
375375
const colord = new Colord(colorString);
376376

377377
const { h, s, l, a } = colord.toHsl();
378+
console.log(colord.rgba, this.opacity);
378379

379380
this.hue = h;
380381
this.saturation = s;
381382
this.lightness = l;
382-
this.alpha = this.opacity ? a * 100 : 100;
383+
this.alpha = this.opacity != undefined ? a * 100 : 100;
383384

384385
const hslaColor = colorString as HslaColor;
385386

@@ -395,7 +396,6 @@ export class UUIColorPickerElement extends LabelMixin('label', LitElement) {
395396
this.dispatchEvent(
396397
new UUIColorPickerChangeEvent(UUIColorPickerChangeEvent.CHANGE),
397398
);
398-
399399
return true;
400400
}
401401

packages/uui-color-picker/lib/uui-color-picker.story.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ export const Inline: Story = {
7373
export const Opacity: Story = {
7474
args: {
7575
opacity: true,
76+
value: undefined,
7677
inline: true,
7778
},
7879
};

0 commit comments

Comments
 (0)