color picker: add alpha
This commit is contained in:
parent
863e56afd0
commit
911888d6e2
2 changed files with 12 additions and 7 deletions
|
|
@ -19,17 +19,17 @@ class ColorPicker extends UiWidget {
|
|||
this.rgb = new Rgb({props: {
|
||||
...Rgb.defaults()._props(),
|
||||
type: 'rgb',
|
||||
label: false,
|
||||
width: 'auto',
|
||||
height: 'auto',
|
||||
alphaStroke: 0,
|
||||
snap: true,
|
||||
alpha: true
|
||||
}, parent: this})
|
||||
this.rgb.container.classList.add('not-editable')
|
||||
|
||||
this.modal = new UiModal({
|
||||
width: 280,
|
||||
height: 280,
|
||||
height: 320,
|
||||
closable: true,
|
||||
title: '',
|
||||
hide: true,
|
||||
|
|
@ -108,7 +108,9 @@ class ColorPicker extends UiWidget {
|
|||
|
||||
setValue(v) {
|
||||
|
||||
this.rgb.setValue(chroma(v).rgb())
|
||||
if (v === 'transparent') v = '#00000000'
|
||||
|
||||
this.rgb.setValue(chroma(v).rgba())
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -287,7 +287,7 @@ osc-inspector-color {
|
|||
background: var(--color-background);
|
||||
flex: 1;
|
||||
width: auto;
|
||||
margin: 8rem;
|
||||
--widget-padding: #{$padding};
|
||||
}
|
||||
|
||||
.actions {
|
||||
|
|
@ -298,14 +298,17 @@ osc-inspector-color {
|
|||
height: 42rem + $padding * 2;
|
||||
line-height: 38rem;
|
||||
flex-shrink: 0;
|
||||
border: $padding solid var(--color-ui-background);
|
||||
padding: 1rem;
|
||||
background: var(--color-ui-background);
|
||||
padding: $padding;
|
||||
.btn {
|
||||
flex: 1;
|
||||
margin: 1rem;;
|
||||
text-overflow: clip;
|
||||
min-width: 0;
|
||||
background: var(--color-ui-button);
|
||||
margin-right: $padding;
|
||||
&:last-child {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue