---
title: "init(selection:supportsOpacity:label:)"
framework: swiftui
role: symbol
role_heading: Initializer
path: "swiftui/colorpicker/init(selection:supportsopacity:label:)"
---

# init(selection:supportsOpacity:label:)

Creates an instance that selects a color.

## Declaration

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

## Parameters

- `selection`: A doc://com.apple.SwiftUI/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.

## See Also

### Creating a color picker

- [init(_:selection:supportsOpacity:)](swiftui/colorpicker/init(_:selection:supportsopacity:).md)
