Documentation ¶
Overview ¶
Package colorpicker provides simple widgets for selecting an RGBA color and for choosing one of a set of colors.
The PickerStyle type can be used to render a colorpicker (the state will be stored in a State). Colorpickers allow choosing specific RGBA values with sliders or providing an RGB hex code.
The MuxStyle type can be used to render a color multiplexer (the state will be stored in a MuxState). Color multiplexers provide a choice from among a set of colors.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type D ¶
type D = layout.Dimensions
type MuxState ¶
MuxState holds the state of a color multiplexer. A color multiplexer allows choosing from among a set of colors.
func NewMuxState ¶
NewMuxState creates a MuxState that will provide choices between the MuxOptions given as parameters.
type MuxStyle ¶
MuxStyle renders a MuxState as a material design themed widget.
type PickerStyle ¶
type PickerStyle struct { *State *material.Theme Label string // MonospaceFace selects the typeface to use for monospace text fields. // The zero value will use the generic family "monospace". MonospaceFace font.Typeface }
PickerStyle renders a color picker using material widgets.
func Picker ¶
func Picker(th *material.Theme, state *State, label string) PickerStyle
Picker creates a pickerstyle from a theme and a state.
func (PickerStyle) Layout ¶
func (p PickerStyle) Layout(gtx layout.Context) layout.Dimensions
Layout renders the PickerStyle into the provided context.
type State ¶
type State struct {
R, G, B, A widget.Float
widget.Editor
// contains filtered or unexported fields
}
State is the state of a colorpicker.