init(selection:supportsOpacity:label:)
Creates an instance that selects a color.
Declaration
init(selection: Binding<CGColor>, supportsOpacity: Bool = true, @ViewBuilder label: () -> Label)Parameters
- selection:
A Binding to the variable that displays the selected
CGColor. - supportsOpacity:
A Boolean value that indicates whether the color picker allows adjusting the selected color’s opacity; the default is
true. - label:
A view that describes the use of the selected color. The system color picker UI sets it’s title using the text from this view.