Change icon color based on state(on/off)

Dude, we had a start here: One button with two actions

And you’re still don’t use the code tags nor have you read the instructions for template or custom button card.