Change entity color based on its state

Otherwise you can do as @tom_l suggests and use the custom button card which allows for custom colors depending on state.