ColorPicker
CSS 形式の RGBA 文字列を返す、ネイティブ SwiftUI カラーピッカーです。
#インポート
github.com/egoist/quickgui/go/ui から ui をインポートします。
import (
"github.com/egoist/quickgui/go/native"
"github.com/egoist/quickgui/go/ui"
)#使い方
func SwiftUiColorPickerExample() *native.Node {
value, setValue := ui.CreateSignal("#2563ebff")
return ui.SwiftUI.Host(
ui.SwiftUIHostProps{MatchContents: true},
func() *native.Node {
return ui.SwiftUI.ColorPicker(ui.SwiftUIColorPickerProps{
Selection: value,
Label: "Accent",
SupportsOpacity: true,
OnSelectionChange: func(next string, _ *native.Event) { setValue(next) },
})
},
)
}#API リファレンス
項目を展開すると説明と完全なシグネチャが表示されます。ダッシュは宣言に既定値が記載されていないことを示します。
SwiftUI.ColorPicker
ソースを見るui.SwiftUI.ColorPicker(props SwiftUIColorPickerProps) *native.NodeTestIDany—
Modifiersany—
Reffunc(*native.Node)—
Receives the retained native node after construction. Keep imperative work in event or lifecycle callbacks.
func(*native.Node)ソースを見る