Fix battery color

pull/1540/head
Stergios Mekras 2022-02-27 23:22:32 +01:00
parent 728ac86aeb
commit ac29a4f5a5
1 changed files with 3 additions and 3 deletions

View File

@ -29,13 +29,13 @@ function d02(value) {
function pollBattery() {
batLevel = E.getBattery();
return batLevel;
}
function getBatteryColor(level) {
var color;
if (level < 0) {
level = pollBattery();
pollBattery();
level = batLevel;
}
if(level>80) {
color = [0,0,1];
@ -54,7 +54,7 @@ function getBatteryColor(level) {
function draw() {
g.drawImage(background);
const color = getBatteryColor();
const color = getBatteryColor(batLevel);
const bat = d02(E.getBattery()) + "%";
const d = new Date();
const day = d.getDate();