Contents

init(_:selection:supportsOpacity:)

Creates a color picker with a text label generated from a title string key.

Declaration

nonisolated init(_ titleKey: LocalizedStringKey, selection: Binding<CGColor>, supportsOpacity: Bool = true)

Parameters

  • titleKey:

    The key for the localized title of the picker.

  • selection:

    A Binding to the variable that displays the selected CGColor.

  • supportsOpacity:

    A Boolean value that indicates whether the color picker allows adjustments to the selected color’s opacity; the default is true.

See Also

Creating a color picker