diff --git a/src/displayapp/screens/BatteryIcon.cpp b/src/displayapp/screens/BatteryIcon.cpp index 6194807d32..784a1de879 100644 --- a/src/displayapp/screens/BatteryIcon.cpp +++ b/src/displayapp/screens/BatteryIcon.cpp @@ -27,15 +27,9 @@ void BatteryIcon::SetBatteryPercentage(uint8_t percentage) { lv_obj_set_height(batteryJuice, percentage * 14 / 100); lv_obj_realign(batteryJuice); if (colorOnLowBattery) { - static constexpr int lowBatteryThreshold = 15; - static constexpr int criticalBatteryThreshold = 5; - if (percentage > lowBatteryThreshold) { - SetColor(LV_COLOR_WHITE); - } else if (percentage > criticalBatteryThreshold) { - SetColor(LV_COLOR_ORANGE); - } else { - SetColor(Colors::deepOrange); - } + uint8_t green = percentage * 255 / 100; + uint8_t red = 255 - green; + SetColor(LV_COLOR_MAKE(red, green, 0x0)); } }