Default [Q] Widget Help

I do not know how to do conditions so if someone can help me make a simple widget it'll be much appreciated.
Here is what I would like it's very basic.

I want a numeric battery indicator that changes color based on amount left. Example I want the number to be green for 100-80 yellow for 79-51 orange for 50-30 and red for 29-0.

I'm sure this is possible I just have no idea how to do conditions. Can someone please explain our Help me make one and do a download link if possible. Thank you.