Skip to content

Latest commit

 

History

History
246 lines (170 loc) · 9.61 KB

class_colorpicker.rst

File metadata and controls

246 lines (170 loc) · 9.61 KB
github_url:hide

ColorPicker

Inherits: :ref:`BoxContainer<class_BoxContainer>` < :ref:`Container<class_Container>` < :ref:`Control<class_Control>` < :ref:`CanvasItem<class_CanvasItem>` < :ref:`Node<class_Node>` < :ref:`Object<class_Object>`

Color picker control.

Description

Displays a color picker widget. Useful for selecting a color from an RGB/RGBA colorspace.

Properties

:ref:`Color<class_Color>` :ref:`color<class_ColorPicker_property_color>` Color( 1, 1, 1, 1 )
:ref:`bool<class_bool>` :ref:`deferred_mode<class_ColorPicker_property_deferred_mode>` false
:ref:`bool<class_bool>` :ref:`edit_alpha<class_ColorPicker_property_edit_alpha>` true
:ref:`bool<class_bool>` :ref:`hsv_mode<class_ColorPicker_property_hsv_mode>` false
:ref:`bool<class_bool>` :ref:`presets_enabled<class_ColorPicker_property_presets_enabled>` true
:ref:`bool<class_bool>` :ref:`presets_visible<class_ColorPicker_property_presets_visible>` true
:ref:`bool<class_bool>` :ref:`raw_mode<class_ColorPicker_property_raw_mode>` false

Methods

void :ref:`add_preset<class_ColorPicker_method_add_preset>` ( :ref:`Color<class_Color>` color )
void :ref:`erase_preset<class_ColorPicker_method_erase_preset>` ( :ref:`Color<class_Color>` color )
:ref:`PackedColorArray<class_PackedColorArray>` :ref:`get_presets<class_ColorPicker_method_get_presets>` ( ) const

Theme Properties

:ref:`Texture2D<class_Texture2D>` add_preset  
:ref:`Texture2D<class_Texture2D>` color_hue  
:ref:`Texture2D<class_Texture2D>` color_sample  
:ref:`int<class_int>` h_width 30
:ref:`int<class_int>` label_width 10
:ref:`int<class_int>` margin 4
:ref:`Texture2D<class_Texture2D>` overbright_indicator  
:ref:`Texture2D<class_Texture2D>` preset_bg  
:ref:`Texture2D<class_Texture2D>` screen_picker  
:ref:`int<class_int>` sv_height 256
:ref:`int<class_int>` sv_width 256

Signals

Emitted when the color is changed.


Emitted when a preset is added.


Emitted when a preset is removed.

Property Descriptions

Default Color( 1, 1, 1, 1 )
Setter set_pick_color(value)
Getter get_pick_color()

The currently selected color.


Default false
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).


Default true
Setter set_edit_alpha(value)
Getter is_editing_alpha()

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


Default false
Setter set_hsv_mode(value)
Getter is_hsv_mode()

If true, allows editing the color with Hue/Saturation/Value sliders.

Note: Cannot be enabled if raw mode is on.


Default true
Setter set_presets_enabled(value)
Getter are_presets_enabled()

If true, the "add preset" button is enabled.


Default true
Setter set_presets_visible(value)
Getter are_presets_visible()

If true, saved color presets are visible.


Default false
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).

Note: Cannot be enabled if HSV mode is on.

Method Descriptions

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.


Removes 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.