We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 553f2d3 commit 5f72ab1Copy full SHA for 5f72ab1
1 file changed
src/widget-form.ts
@@ -478,8 +478,10 @@ export class WidgetForm extends LitElement {
478
const bgColorOpaque = bgColor?.startsWith('rgba')
479
? bgColor.replace(/rgba\(([^)]+),\s*[\d.]+\)/, 'rgb($1)')
480
: bgColor?.startsWith('#') && bgColor.length === 9
481
- ? bgColor.substring(0, 7)
482
- : bgColor
+ ? bgColor.substring(0, 7) // #RRGGBBAA -> #RRGGBB
+ : bgColor?.startsWith('#') && bgColor.length === 5
483
+ ? bgColor.substring(0, 4) // #RGBA -> #RGB
484
+ : bgColor
485
return html`
486
<style>
487
:host {
0 commit comments