struct ContentView: View { @State private var bgColor = Color.red var body: some View { VStack { ColorPicker("Set the background color", selection: $bgColor, supportsOpacity: false) } .frame(maxWidth: .infinity, maxHeight: .infinity) .background(bgColor) } }struct ContentView: View { @State private var bgColor = Color(.red) var body: some View { VStack { ColorPicker("Pick a color", selection: $bgColor) } } }