Progress bar with colours

To make the color of a bar smoothly interleave for example from green trough yellow to red, you can stack 3 duplicate layers (red, yellow, green) and set their opacity to continuously fade with lowering battery charge.
For example
-bottom layer: Yellow, opacity 100, background opacity 25%
image

-middle layer: Red, opacity 100-2*[BATT_PER], bgr. 25%
image

image

-top layer: Green, opacity 0+2*[BATT_PER]-100, bgr. 25%
image

image

2 Likes