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.

ColorPicker

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

A widget that provides an interface for selecting or modifying a color.

Description

A widget that provides an interface for selecting or modifying a color. It can optionally provide functionalities like a color sampler (eyedropper), color modes, and presets.

Note: This control is the color picker widget itself. You can use a ColorPickerButton instead if you need a button that brings up a ColorPicker in a popup.

Tutorials

Properties

bool

can_add_swatches

true

Color

color

Color(1, 1, 1, 1)

ColorModeType

color_mode

0

bool

color_modes_visible

true

bool

deferred_mode

false

bool

edit_alpha

true

bool

hex_visible

true

PickerShapeType

picker_shape

0

bool

presets_visible

true

bool

sampler_visible

true

bool

sliders_visible

true

Methods

void

add_preset(color: Color)

void

add_recent_preset(color: Color)

void

erase_preset(color: Color)

void

erase_recent_preset(color: Color)

PackedColorArray

get_presets() const

PackedColorArray

get_recent_presets() const

Theme Properties

int

center_slider_grabbers

1

int

h_width

30

int

label_width

10

int

margin

4

int

sv_height

256

int

sv_width

256

Texture2D

add_preset

Texture2D

bar_arrow

Texture2D

color_hue

Texture2D

color_okhsl_hue

Texture2D

expanded_arrow

Texture2D

folded_arrow

Texture2D

overbright_indicator

Texture2D

picker_cursor

Texture2D

sample_bg

Texture2D

sample_revert

Texture2D

screen_picker

Texture2D

shape_circle

Texture2D

shape_rect

Texture2D

shape_rect_wheel


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.


Enumerations