Inheritance #

ColorPickerButton
Table of contents

ColorPickerButton #

is_instantiable, Node, core, not_builtin_classes

A button that brings up a ColorPicker when pressed.

Encapsulates a ColorPicker, making it accessible by pressing a button. Pressing the button will toggle the ColorPicker's visibility.

See also BaseButton which contains common properties and methods associated with this node.

Note: By default, the button may not be wide enough for the color preview swatch to be visible. Make sure to set Control.custom_minimum_size to a big enough value to give the button enough space.

Members #

var color: Color = Color(0, 0, 0, 1)#

The currently selected color.

var edit_alpha: bool = true#

If true, the alpha channel in the displayed ColorPicker will be visible.

var toggle_mode: bool = true#

Methods #

func get_picker() -> ColorPicker#

Returns the ColorPicker that this node toggles.

Warning: This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their CanvasItem.visible property.

func get_popup() -> PopupPanel#

Returns the control's PopupPanel which allows you to connect to popup signals. This allows you to handle events when the ColorPicker is shown or hidden.

Warning: This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their Window.visible property.

Annotations #

Constants #

Constructors #

Enums #

Operators #

Signals #

signal color_changed(color: Color)#

Emitted when the color changes.

signal picker_created()#

Emitted when the ColorPicker is created (the button is pressed for the first time).

Emitted when the ColorPicker is closed.

Theme Items #

self["theme_override_icons/bg"] = icon as Texture2D#

The background of the color preview rect on the button.

Tutorials #