ColorPickerButton

Inherits: Button < BaseButton < Control < CanvasItem < Node < Object

Button that pops out a ColorPicker.

Description

Encapsulates a ColorPicker making it accessible by pressing a button. Pressing the button will toggle the ColorPicker 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.rect_min_size to a big enough value to give the button enough space.

Properties

Color

color

Color(0, 0, 0, 1)

bool

edit_alpha

true

bool

toggle_mode

true (parent override)

Signals

  • color_changed ( Color color )

Emitted when the color changes.


  • picker_created ( )

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


  • popup_closed ( )

Emitted when the ColorPicker is closed.

Property Descriptions

Default

Color(0, 0, 0, 1)

Setter

set_pick_color(value)

Getter

get_pick_color()

The currently selected color.


Default

true

Setter

set_edit_alpha(value)

Getter

is_editing_alpha()

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

Method Descriptions

Returns the ColorPicker that this node toggles.


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.

Theme Property Descriptions

The background of the color preview rect on the button.


StyleBox used when the ColorPickerButton is disabled.


StyleBox used when the ColorPickerButton is focused. It is displayed over the current StyleBox, so using StyleBoxEmpty will just disable the focus visual effect.


Font of the ColorPickerButton's text.


Default

Color(1, 1, 1, 1)

Default text Color of the ColorPickerButton.


  • Color font_disabled_color

Default

Color(0.9, 0.9, 0.9, 0.3)

Text Color used when the ColorPickerButton is disabled.


Default

Color(1, 1, 1, 1)

Text Color used when the ColorPickerButton is being hovered.


  • Color font_outline_color

Default

Color(1, 1, 1, 1)

The tint of text outline of the ColorPickerButton.


  • Color font_pressed_color

Default

Color(0.8, 0.8, 0.8, 1)

Text Color used when the ColorPickerButton is being pressed.


  • int font_size

Font size of the ColorPickerButton's text.


StyleBox used when the ColorPickerButton is being hovered.


  • int hseparation

Default

2

The horizontal space between ColorPickerButton's icon and text.


Default StyleBox for the ColorPickerButton.


  • int outline_size

Default

0

The size of the text outline.


StyleBox used when the ColorPickerButton is being pressed.