@@ -18,6 +18,7 @@ interface SettingsData {
1818 column_span ?: number ;
1919 background_type : "none" | "color" ;
2020 background_color ?: number [ ] ;
21+ background_opacity ?: number ;
2122}
2223
2324@customElement ( "hui-section-settings-editor" )
@@ -84,6 +85,19 @@ export class HuiDialogEditSection extends LitElement {
8485 } ,
8586 disabled : ! enableBackground ,
8687 } ,
88+ {
89+ name : "background_opacity" ,
90+ selector : {
91+ number : {
92+ min : 0 ,
93+ max : 100 ,
94+ step : 1 ,
95+ mode : "slider" ,
96+ unit_of_measurement : "%" ,
97+ } ,
98+ } ,
99+ disabled : ! enableBackground ,
100+ } ,
87101 ] ,
88102 } ,
89103 ] ,
@@ -108,6 +122,7 @@ export class HuiDialogEditSection extends LitElement {
108122 background_color : this . config . style ?. background_color
109123 ? hex2rgb ( this . config . style ?. background_color as any )
110124 : [ ] ,
125+ background_opacity : this . config . style ?. background_opacity || 100 ,
111126 } ;
112127
113128 const schema = this . _schema (
@@ -156,11 +171,13 @@ export class HuiDialogEditSection extends LitElement {
156171 newConfig . style = {
157172 ...newConfig . style ,
158173 background_color : rgb2hex ( newData . background_color as any ) ,
174+ background_opacity : newData . background_opacity ,
159175 } ;
160176 } else {
161177 newConfig . style = {
162178 ...newConfig . style ,
163179 background_color : undefined ,
180+ background_opacity : undefined ,
164181 } ;
165182 }
166183
0 commit comments