garminBatteryIndicatorLabelColor.mc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Update the battery text color | |
function updateBatteryTextColor(updateBatPerc){ | |
var _color = Graphics.COLOR_GREEN; | |
//Setting battery label color based on percentage | |
if (updateBatPerc > 75){ | |
_color = Graphics.COLOR_DK_GREEN; | |
} | |
if (updateBatPerc < 75 && updateBatPerc >= 25){ | |
_color = Graphics.COLOR_YELLOW; | |
} | |
if (updateBatPerc < 25){ | |
_color = Graphics.COLOR_RED; | |
} | |
var _viewObject = View.findDrawableById("BatteryLabel"); | |
_viewObject.setColor(_color); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment