LavaUI docs

struct ColorPicker

Swift

struct ColorPicker

Saturation–value square, hue strip, hex, and an optional alpha slider.

The binding is an authored sRGB Color — the same numbers a picker and a hex field agree on. The square is HSV rather than HSL because the top-right corner has to be the pure hue; HSL puts that in the middle and feels like the control is fighting the hand.

@State private var fill = Color(r: 0.2, g: 0.45, b: 0.8)
ColorPicker(color: $fill)

Sources/LavaUI/ColorPicker.swift:14

Constructors

init(color: Binding<Color>, showsAlpha: Bool = false, showsHex: Bool = true)

Not documented.

Sources/LavaUI/ColorPicker.swift:24

Properties

var body: some View { get }

Not documented.

Sources/LavaUI/ColorPicker.swift:34

@Binding var color: Color { get nonmutating set }

Not documented.

Sources/LavaUI/ColorPicker.swift:15

var showsAlpha: Bool

Not documented.

Sources/LavaUI/ColorPicker.swift:16

var showsHex: Bool

Not documented.

Sources/LavaUI/ColorPicker.swift:17