Table of Contents

Class ColorPickerButton

A button that brings up a ColorPicker when pressed.

Inheritance
ColorPickerButton

Remarks

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 custom_minimum_size to a big enough value to give the button enough space.

See Also

Properties

color

The currently selected color.

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

Property Value

Color

Remarks

  • void set_pick_color(Color value)
  • Color get_pick_color

edit_alpha

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

var edit_alpha : bool = true

Property Value

bool

Remarks

  • void set_edit_alpha(bool value)
  • bool is_editing_alpha

bg

Theme Property

The background of the color preview rect on the button.

Texture2D bg

Property Value

Texture2D

Methods

get_picker

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 visible property.

ColorPicker get_picker

get_popup

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 visible property.

PopupPanel get_popup

Events

color_changed(Color)

Emitted when the color changes.

signal color_changed(Color color)

Parameters

color Color

picker_created

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

signal picker_created

popup_closed

Emitted when the ColorPicker is closed.

signal popup_closed