We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0fabfe9 commit dee8fffCopy full SHA for dee8fff
src/displayapp/screens/BatteryIcon.cpp
@@ -29,15 +29,7 @@ void BatteryIcon::SetBatteryPercentage(uint8_t percentage) {
29
lv_obj_set_height(batteryJuice, percentage * 14 / 100);
30
lv_obj_realign(batteryJuice);
31
if (colorOnLowBattery) {
32
- static constexpr int lowBatteryThreshold = 15;
33
- static constexpr int criticalBatteryThreshold = 5;
34
- if (percentage > lowBatteryThreshold) {
35
- SetColor(LV_COLOR_WHITE);
36
- } else if (percentage > criticalBatteryThreshold) {
37
- SetColor(LV_COLOR_ORANGE);
38
- } else {
39
- SetColor(Colors::deepOrange);
40
- }
+ SetColor(ColorFromPercentage(percentage));
41
}
42
43
0 commit comments