Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

ColorPickerButton

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

A button that brings up a ColorPicker when pressed.

Description

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.

Tutorials

Properties

Color

color

Color(0, 0, 0, 1)

bool

edit_alpha

true

bool

toggle_mode

true (overrides BaseButton)

Methods

ColorPicker

get_picker ( )

PopupPanel

get_popup ( )

Theme Properties

Color

font_color

Color(1, 1, 1, 1)

Color

font_disabled_color

Color(0.9, 0.9, 0.9, 0.3)

Color

font_focus_color

Color(1, 1, 1, 1)

Color

font_hover_color

Color(1, 1, 1, 1)

Color

font_outline_color

Color(1, 1, 1, 1)

Color

font_pressed_color

Color(0.8, 0.8, 0.8, 1)

int

h_separation

4

int

outline_size

0

Font

font

int

font_size

Texture2D

bg

StyleBox

disabled

StyleBox

focus

StyleBox

hover

StyleBox

normal

StyleBox

pressed


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

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

  • void set_pick_color ( Color value )

  • Color get_pick_color ( )

The currently selected color.


bool edit_alpha = true

  • void set_edit_alpha ( bool value )

  • bool is_editing_alpha ( )

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


Method Descriptions

ColorPicker get_picker ( )

Returns the