Battery color based on percentage

I just typed in a command to change the battery icon colour depending on it's s percentage. I used this command:


I made globals for every 'rank' of the battery percentage, so gv(good) is 60-80%, and I have created all the colors globals.

Any tips are appreciated!

I get this error when I finish the command: