Conditional Formatting For Buttons

Hi everyone,

I'm not sure if this is already possible or not, but I would love to have icons or button background colors that can change based on various OS or application conditions. For example I have 4 buttons to toggle between desktops, but I would love to have a different background color for the active desktop so that I can easily glance and see which is open. I'm sure that there would be a lot of other use cases for a feature like this, but I'm not sure how feasible it would be to implement or if it would hog system resources and drain the battery.