Documentation
¶
Overview ¶
A widget that provides an interface for selecting or modifying a color. It can optionally provide functionalities like a color sampler (eyedropper), color modes, and presets.
Note: This control is the color picker widget itself. You can use a ColorPickerButton instead if you need a button that brings up a ColorPicker in a popup.
Index ¶
- type Advanced
- type Any
- type ColorModeType
- type Extension
- func (self *Extension[T]) AsBoxContainer() BoxContainer.Instance
- func (self *Extension[T]) AsCanvasItem() CanvasItem.Instance
- func (self *Extension[T]) AsColorPicker() Instance
- func (self *Extension[T]) AsContainer() Container.Instance
- func (self *Extension[T]) AsControl() Control.Instance
- func (self *Extension[T]) AsNode() Node.Instance
- func (self *Extension[T]) AsObject() [1]gd.Object
- func (self *Extension[T]) AsVBoxContainer() VBoxContainer.Instance
- type ID
- type Instance
- func (self Instance) AddPreset(color Color.RGBA)
- func (self Instance) AddRecentPreset(color Color.RGBA)
- func (self Instance) AsBoxContainer() BoxContainer.Instance
- func (self Instance) AsCanvasItem() CanvasItem.Instance
- func (self Instance) AsColorPicker() Instance
- func (self Instance) AsContainer() Container.Instance
- func (self Instance) AsControl() Control.Instance
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsVBoxContainer() VBoxContainer.Instance
- func (self Instance) CanAddSwatches() bool
- func (self Instance) Color() Color.RGBA
- func (self Instance) ColorMode() ColorModeType
- func (self Instance) ColorModesVisible() bool
- func (self Instance) DeferredMode() bool
- func (self Instance) EditAlpha() bool
- func (self Instance) EditIntensity() bool
- func (self Instance) ErasePreset(color Color.RGBA)
- func (self Instance) EraseRecentPreset(color Color.RGBA)
- func (self Instance) GetPresets() []Color.RGBA
- func (self Instance) GetRecentPresets() []Color.RGBA
- func (self Instance) HexVisible() bool
- func (self Instance) ID() ID
- func (self Instance) OnColorChanged(cb func(color Color.RGBA), flags ...Signal.Flags)
- func (self Instance) OnPresetAdded(cb func(color Color.RGBA), flags ...Signal.Flags)
- func (self Instance) OnPresetRemoved(cb func(color Color.RGBA), flags ...Signal.Flags)
- func (self Instance) PickerShape() PickerShapeType
- func (self Instance) PresetsVisible() bool
- func (self Instance) SamplerVisible() bool
- func (self Instance) SetCanAddSwatches(value bool)
- func (self Instance) SetColor(value Color.RGBA)
- func (self Instance) SetColorMode(value ColorModeType)
- func (self Instance) SetColorModesVisible(value bool)
- func (self Instance) SetDeferredMode(value bool)
- func (self Instance) SetEditAlpha(value bool)
- func (self Instance) SetEditIntensity(value bool)
- func (self Instance) SetHexVisible(value bool)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetPickerShape(value PickerShapeType)
- func (self Instance) SetPresetsVisible(value bool)
- func (self Instance) SetSamplerVisible(value bool)
- func (self Instance) SetSlidersVisible(value bool)
- func (self Instance) SlidersVisible() bool
- func (self Instance) Virtual(name string) reflect.Value
- type PickerShapeType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type ColorModeType ¶
type ColorModeType int //gd:ColorPicker.ColorModeType
const ( // Allows editing the color with Red/Green/Blue sliders in sRGB color space. ModeRgb ColorModeType = 0 // Allows editing the color with Hue/Saturation/Value sliders. ModeHsv ColorModeType = 1 ModeRaw ColorModeType = 2 // Allows editing the color with Red/Green/Blue sliders in linear color space. ModeLinear ColorModeType = 2 // Allows editing the color with Hue/Saturation/Lightness sliders. // // OKHSL is a new color space similar to HSL but that better match perception by leveraging the Oklab color space which is designed to be simple to use, while doing a good job at predicting perceived lightness, chroma and hue. // // [Okhsv and Okhsl color spaces] // // [Okhsv and Okhsl color spaces]: https://bottosson.github.io/posts/colorpicker/ ModeOkhsl ColorModeType = 3 )
type Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension
func (*Extension[T]) AsBoxContainer ¶
func (self *Extension[T]) AsBoxContainer() BoxContainer.Instance
func (*Extension[T]) AsCanvasItem ¶
func (self *Extension[T]) AsCanvasItem() CanvasItem.Instance
func (*Extension[T]) AsColorPicker ¶
func (*Extension[T]) AsContainer ¶
func (*Extension[T]) AsVBoxContainer ¶
func (self *Extension[T]) AsVBoxContainer() VBoxContainer.Instance
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
type Instance ¶
type Instance [1]gdclass.ColorPicker
Instance of the class with convieniently typed arguments and results.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AddPreset ¶
Adds the given color to a list of color presets. The presets are displayed in the color picker and the user will be able to select them.
Note: The presets list is only for this color picker.
func (Instance) AddRecentPreset ¶
Adds the given color to a list of color recent presets so that it can be picked later. Recent presets are the colors that were picked recently, a new preset is automatically created and added to recent presets when you pick a new color.
Note: The recent presets list is only for this color picker.
func (Instance) AsBoxContainer ¶
func (self Instance) AsBoxContainer() BoxContainer.Instance
func (Instance) AsCanvasItem ¶
func (self Instance) AsCanvasItem() CanvasItem.Instance
func (Instance) AsColorPicker ¶
func (Instance) AsContainer ¶
func (Instance) AsVBoxContainer ¶
func (self Instance) AsVBoxContainer() VBoxContainer.Instance
func (Instance) CanAddSwatches ¶
func (Instance) ColorMode ¶
func (self Instance) ColorMode() ColorModeType
func (Instance) ColorModesVisible ¶
func (Instance) DeferredMode ¶
func (Instance) EditIntensity ¶
func (Instance) ErasePreset ¶
Removes the given color from the list of color presets of this color picker.
func (Instance) EraseRecentPreset ¶
Removes the given color from the list of color recent presets of this color picker.
func (Instance) GetPresets ¶
Returns the list of colors in the presets of the color picker.
func (Instance) GetRecentPresets ¶
Returns the list of colors in the recent presets of the color picker.
func (Instance) HexVisible ¶
func (Instance) OnColorChanged ¶
func (Instance) OnPresetAdded ¶
func (Instance) OnPresetRemoved ¶
func (Instance) PickerShape ¶
func (self Instance) PickerShape() PickerShapeType
func (Instance) PresetsVisible ¶
func (Instance) SamplerVisible ¶
func (Instance) SetCanAddSwatches ¶
func (Instance) SetColorMode ¶
func (self Instance) SetColorMode(value ColorModeType)
func (Instance) SetColorModesVisible ¶
func (Instance) SetDeferredMode ¶
func (Instance) SetEditAlpha ¶
func (Instance) SetEditIntensity ¶
func (Instance) SetHexVisible ¶
func (Instance) SetPickerShape ¶
func (self Instance) SetPickerShape(value PickerShapeType)
func (Instance) SetPresetsVisible ¶
func (Instance) SetSamplerVisible ¶
func (Instance) SetSlidersVisible ¶
func (Instance) SlidersVisible ¶
type PickerShapeType ¶
type PickerShapeType int //gd:ColorPicker.PickerShapeType
const ( // HSV Color Model rectangle color space. ShapeHsvRectangle PickerShapeType = 0 // HSV Color Model rectangle color space with a wheel. ShapeHsvWheel PickerShapeType = 1 // HSV Color Model circle color space. Use Saturation as a radius. ShapeVhsCircle PickerShapeType = 2 // HSL OK Color Model circle color space. ShapeOkhslCircle PickerShapeType = 3 // The color space shape and the shape select button are hidden. Can't be selected from the shapes popup. ShapeNone PickerShapeType = 4 // OKHSL Color Model rectangle with constant lightness. ShapeOkHsRectangle PickerShapeType = 5 // OKHSL Color Model rectangle with constant saturation. ShapeOkHlRectangle PickerShapeType = 6 )