ColorPicker

Inherits: BoxContainer < Container < Control < CanvasItem < Node < Object

Category: Core

Brief Description

Color picker control.

Methods

void add_preset ( Color color )
void erase_preset ( Color color )
PoolColorArray get_presets ( ) const

Theme Properties

Texture add_preset
Texture color_hue
Texture color_sample
int h_width
int label_width
int margin
Texture preset_bg
Texture screen_picker
int sv_height
int sv_width

Signals

  • color_changed ( Color color )

Emitted when the color is changed.

  • preset_added ( Color color )

Emitted when a preset is added.

  • preset_removed ( Color color )

Emitted when a preset is removed.

Description

Control node displaying a color picker widget. It's useful for selecting a color from an RGB/RGBA colorspace.

Property Descriptions

Setter set_pick_color(value)
Getter get_pick_color()

The currently selected color.

  • bool deferred_mode
Setter set_deferred_mode(value)
Getter is_deferred_mode()

If true, the color will apply only after the user releases the mouse button, otherwise it will apply immediately even in mouse motion event (which can cause performance issues).

Setter set_edit_alpha(value)
Getter is_editing_alpha()

If true, shows an alpha channel slider (transparency).

  • bool presets_enabled
Setter set_presets_enabled(value)
Getter are_presets_enabled()
  • bool presets_visible
Setter set_presets_visible(value)
Getter are_presets_visible()
Setter set_raw_mode(value)
Getter is_raw_mode()

If true, allows the color R, G, B component values to go beyond 1.0, which can be used for certain special operations that require it (like tinting without darkening or rendering sprites in HDR).

Method Descriptions

  • void add_preset ( Color color )

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.

  • void erase_preset ( Color color )

Remove the given color from the list of color presets of this color picker.

Returns the list of colors in the presets of the color picker.