I have a play/pause button that changes when pressed. At the moment it just fades in and out but I would like it to perform a animation that looks like the new colour is flowing over the old one.

This is what I have so far:
if(meditationViewModel.timerIsRunning){
HStack{
Image(systemName: "pause")
Text("STOP")
.bold()
}
.padding()
.foregroundColor(.white)
.background(Color.red)
.cornerRadius(25)
.shadow(radius: 20)
}else{
HStack{
Image(systemName: "play")
Text("PLAY")
.bold()
}
.padding()
.foregroundColor(.white)
.background(Color.green)
.cornerRadius(25)
}
The change of meditationViewModel.timerIsRunning happens elsewhere.



