Adding the Image view and using the hueRotation modifier
With the background set up and all of the variables in place, let’s add an ImageView
to display the images, and add the hueRotation
modifier to it.
Add the following code right after the scaleEffect
modifier:
Image(selectedImage).resizable().padding(20).frame(width: 400, height: 400) .hueRotation(.degrees(shiftColors ? 360 : 0)) .animation(Animation.easeInOut(duration: 2).delay(0.3).repeatForever(autoreverses: true), value: shiftColors) .onAppear() { shiftColors.toggle() } } &...