Change color for the icon when I use badges

Hello, I want to add my motion, doors, and windows sensors as badges to a lovelace view. It works, and the icon changes when there is a motion or someone opened a door or window, but it does not change color. Is there any way to make it change color during a motion as it happens on any card that I use with lovelace views?