Why can't I use if else to change the color of the RGB led?

Tks. But i tried and it doesn't work