One Logo Pool Ball
SwiftUI · IOS API REFERENCE

ColorPicker

struct · iOS 14.0+ · SDK 27.1

nonisolated struct ColorPicker<Label> where Label : View

A control used to select a color from the system color picker UI. The color picker shows the currently selected color and displays the larger system color picker that allows people to select a new color. By default color picker supports colors with opacity; to disable opacity support, set the `supportsOpacity` parameter to `false`. In this mode the color picker won't show controls for adjusting the opacity of the selected color, and strips out opacity from any color set programmatically or selected from the user's system favorites. You use `ColorPicker` by embedding it inside a view hierarchy and initializing it with a title string and a ``Binding`` to a ``Color``: struct FormattingControls: View { @State private var bgColor = Color(.sRGB, red: 0.98, green: 0.9, blue: 0.2) var body: some View { VStack { ColorPicker("Alignment Guides", selection: $bgColor) } } }

Members (0)

This type has no directly callable members in this snapshot. See the framework’s skipped declarations for unsupported APIs.

Skipped declarations

3 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

ColorPicker.init(selection:supportsOpacity:label:)

callback cannot propagate synchronous failure

ColorPicker.init(selection:supportsOpacity:label:)

callback cannot propagate synchronous failure

ColorPicker.body

This protocol needs associated types that cannot yet cross the bridge.

All SwiftUI types →