<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/ColorPicker/init(selection:supportsOpacity:label:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI11ColorPickerV9selection15supportsOpacity5labelACyxGAA7BindingVySo10CGColorRefaG_SbxyXEtcfc::OverloadGroup"
  },
  "title" : "init(selection:supportsOpacity:label:)"
}
-->

# init(selection:supportsOpacity:label:)

Creates an instance that selects a color.

```
nonisolated init(selection: Binding<CGColor>, supportsOpacity: Bool = true, @ContentBuilder label: () -> Label)
```

## Parameters

`selection`

A [`Binding`](/documentation/SwiftUI/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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)