Creating the target and guess rectangles
So far, we have given the user a guess circle so they can see how close they are coming to the target color. Let’s do something similar to that and give them another visual cue – let’s create a guess rectangle and a target rectangle, and put them directly under the Picker
control. We can also add an RGB value indicator, so they can see the actual values of each slider as they change, which can be helpful when they’re trying to figure out how much of the slider they need to move and in which direction.
Start by creating a new file to make these rectangles, called TargetAndGuessRectView
. This file will contain very similar code to the TargetAndGuessCircleView
file, which means adding the needed Binding
properties:
@Binding var redTarget: Double @Binding var greenTarget: Double @Binding var blueTarget: Double @Binding...