Structure

ColorPicker

A control used to select a color from the system color picker UI. ある色をシステムカラーピッカ−UIから選択するために使われるあるコントロール。

Declaration 宣言

struct ColorPicker<Label> where Label : View

Overview 概要

The color picker provides a color well that shows the currently selected color, and displays the larger system color picker that allows users to select a new color.

By default color picker supports colors with opacity; to disable opacity support, set the supportsOpacity parameter to false. In this mode the color picker won’t show controls for adjusting the opacity of the selected color, and strips out opacity from any color set programmatically or selected from the user’s system favorites.

You use ColorPicker by embedding it inside a view hierarchy and initializing it with a title string and a Binding to a Color:


struct FormattingControls: View {
    @State private var bgColor =
        Color(.sRGB, red: 0.98, green: 0.9, blue: 0.2)


    var body: some View {
        VStack {
            ColorPicker("Alignment Guides", selection: $bgColor)
        }
    }
}

Topics 話題

Creating a Color Picker カラーピッカーを作成する

Creating a Core Graphics Color Picker

Supporting Types 支援を行う型

Default Implementations 省略時実装

Relationships 関係

Conforms To 次に準拠

See Also 参照

Pickers