D
Deleted User
Guest
would this be a better battery color and indicator or no?
Code:
void GenerateBatteryBitmap(u8* bitmap, u32 width, u32 height, u32 color_bg) {
const u32 color_outline = COLOR_ORANGE;
const u32 color_inline = COLOR_BLACK;
const u32 color_inside = COLOR_GREY;
if ((width < 8) || (height < 6)) return;
u32 battery;
bool is_charging;
CheckBattery(&battery, &is_charging);
u32 color_battery = (is_charging) ? COLOR_BLUE :
(battery > 75) ? COLOR_GREEN : (battery > 50) ? COLOR_YELLOW : (battery > 25) ? COLOR_ORANGE : COLOR_RED;