Proper way to format posted code as per the instructions… (I already fixed your post)
As for your question… your code works fine… although you do not need the button to be 255 just to toggle the LED ON as you are using a different process then sending an intensity value.
As for the “colouring” double check your spelling and syntax in the actual code.