diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/indicator/battery-level-widget.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/indicator/battery-level-widget.component.ts index a23814343a..5d42313c58 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/indicator/battery-level-widget.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/indicator/battery-level-widget.component.ts @@ -191,25 +191,25 @@ export class BatteryLevelWidgetComponent implements OnInit, OnDestroy, AfterView this.showValue = this.settings.showValue; this.autoScaleValueSize = this.showValue && this.settings.autoScaleValueSize; this.valueStyle = textStyle(this.settings.valueFont); - this.valueColor = ColorProcessor.fromColorProcessingSettings({ + this.valueColor = ColorProcessor.fromColorProcessorSettings({ settings: this.settings.valueColor, ctx: this.ctx, minGradientValue: 0, - maxGradientValue: 0 + maxGradientValue: 100 }); - this.batteryLevelColor = ColorProcessor.fromColorProcessingSettings({ + this.batteryLevelColor = ColorProcessor.fromColorProcessorSettings({ settings: this.settings.batteryLevelColor, ctx: this.ctx, minGradientValue: 0, - maxGradientValue: 0 + maxGradientValue: 100 }); - this.batteryShapeColor = ColorProcessor.fromColorProcessingSettings({ + this.batteryShapeColor = ColorProcessor.fromColorProcessorSettings({ settings: this.settings.batteryShapeColor, ctx: this.ctx, minGradientValue: 0, - maxGradientValue: 0 + maxGradientValue: 100 }); this.backgroundStyle$ = backgroundStyle(this.settings.background, this.imagePipe, this.sanitizer); diff --git a/ui-ngx/src/app/shared/models/widget-settings.models.ts b/ui-ngx/src/app/shared/models/widget-settings.models.ts index 9c3cb68a30..e3e4810934 100644 --- a/ui-ngx/src/app/shared/models/widget-settings.models.ts +++ b/ui-ngx/src/app/shared/models/widget-settings.models.ts @@ -361,13 +361,13 @@ export interface ColorProcessorSettings { export abstract class ColorProcessor { static fromSettings(color: ColorSettings, ctx?: WidgetContext): ColorProcessor { - return ColorProcessor.fromColorProcessingSettings({ + return ColorProcessor.fromColorProcessorSettings({ settings: color, ctx }); } - static fromColorProcessingSettings(setting: ColorProcessorSettings): ColorProcessor { + static fromColorProcessorSettings(setting: ColorProcessorSettings): ColorProcessor { const settings = setting.settings || constantColor(null); switch (settings.type) { case ColorType.constant: