>>5700862Using this knowledge I added another colour.
This code will make a meter:
-Display battery level
-Make meter green when 100%
-Make meter blue when charging
-Make meter red when 15% or lower
-Make meter orange when 33% or lower
Because of the way they're ordered, the meter will be green at 100% even while plugged in, it will be blue while charging even if it's below the "low" threshold, and it will be red while below 16% despite also being below 34%. You can easily rearrange them and change the numbers and colours if you want.