inspector: display transparent colors & ensure color picker is always visible

This commit is contained in:
bordun 2020-05-14 11:31:31 +02:00
parent fb0b629b1c
commit d269c30bae
2 changed files with 3 additions and 2 deletions

View file

@ -95,10 +95,10 @@ class UiInspectorField extends UiWidget {
let style = window.getComputedStyle(this.widget.container),
colorData = this.widget.constructor.cssVariables.find(x=>x.js === this.name),
val = '#000'
val = 'transparent'
try {
val = chroma(style.getPropertyValue(colorData.css).trim()).hex('rgb')
val = chroma(style.getPropertyValue(colorData.css).trim()).hex('rgba')
} catch(e) {}
let picker = html`<osc-inspector-color type="text" name="${this.name}" value="${val}" style="--color-picker-value: ${val}"></osc-inspector-color>`