inputs/DSColorPicker
DSColorPicker
inputsColour swatch grid with a custom-colour option via the system colour picker. Supports a predefined palette.
iOS 17+macOS 14+
Purpose
Label colours, project/tag colour assignment, and theme customisation.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| selectionreq | Binding<Color> | โ | Currently selected colour. |
| palette | [Color] | DSColor.palette | Swatch colours to display. |
| label | String? | nil | Field label. |
| allowCustom | Bool | true | Shows the system colour picker as the last swatch. |
Examples
Project colour
Colour picker in a project creation form.
swift
DSColorPicker(
selection: $project.color,
label: "Project colour",
palette: [.red, .orange, .yellow, .green, .blue, .purple, .pink]
)