Use dynamic classes property of the button , which checks the the status if Favourite product is added -
For example , create FavoriteProduct entity and associate it with the selected Product when adding to favorites. Delete the associated object when removing from favorites.
create css classes - button-red, button-blue
Add this to the namic classes property of the button AddToFavourite
if $FavouriteProduct/FavouriteProduct_Product = empty then 'button-red' else 'button-green'