2017-09-12 22:42:36 +02:00
<?xml version="1.0" encoding="UTF-8" ?>
2021-11-05 15:02:42 +01:00
<class name= "ColorPicker" inherits= "BoxContainer" version= "3.5" >
2017-09-12 22:42:36 +02:00
<brief_description >
Color picker control.
</brief_description>
<description >
2021-09-25 01:21:39 +02:00
Displays a color picker widget. Useful for selecting a color from an RGB/RGBA colorspace.
[b]Note:[/b] 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 pop-up.
2017-09-12 22:42:36 +02:00
</description>
<tutorials >
2020-10-01 10:34:47 +02:00
<link title= "Tween Demo" > https://godotengine.org/asset-library/asset/146</link>
2017-09-12 22:42:36 +02:00
</tutorials>
<methods >
<method name= "add_preset" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "color" type= "Color" />
2017-09-12 22:42:36 +02:00
<description >
2019-06-22 01:04:47 +02:00
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.
2021-10-05 14:24:34 +02:00
[b]Note:[/b] The presets list is only for [i]this[/i] color picker.
2017-09-12 22:42:36 +02:00
</description>
</method>
2018-10-03 16:12:38 +02:00
<method name= "erase_preset" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "color" type= "Color" />
2018-10-03 16:12:38 +02:00
<description >
2019-06-22 01:04:47 +02:00
Removes the given color from the list of color presets of this color picker.
2018-10-03 16:12:38 +02:00
</description>
</method>
2018-12-13 15:12:25 +01:00
<method name= "get_presets" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "PoolColorArray" />
2018-10-03 16:12:38 +02:00
<description >
2019-05-24 04:15:43 +02:00
Returns the list of colors in the presets of the color picker.
2018-10-03 16:12:38 +02:00
</description>
</method>
2017-09-12 22:42:36 +02:00
</methods>
2018-01-11 23:38:35 +01:00
<members >
2019-06-29 12:38:01 +02:00
<member name= "color" type= "Color" setter= "set_pick_color" getter= "get_pick_color" default= "Color( 1, 1, 1, 1 )" >
2018-01-11 23:38:35 +01:00
The currently selected color.
</member>
2019-06-29 12:38:01 +02:00
<member name= "deferred_mode" type= "bool" setter= "set_deferred_mode" getter= "is_deferred_mode" default= "false" >
2018-12-20 13:46:54 +01:00
If [code]true[/code], 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).
2018-07-26 11:56:21 +02:00
</member>
2019-06-29 12:38:01 +02:00
<member name= "edit_alpha" type= "bool" setter= "set_edit_alpha" getter= "is_editing_alpha" default= "true" >
2021-12-24 09:51:31 +01:00
If [code]true[/code], shows an alpha channel slider (opacity).
2018-01-11 23:38:35 +01:00
</member>
2019-06-29 12:38:01 +02:00
<member name= "hsv_mode" type= "bool" setter= "set_hsv_mode" getter= "is_hsv_mode" default= "false" >
2019-06-22 01:04:47 +02:00
If [code]true[/code], allows editing the color with Hue/Saturation/Value sliders.
2019-05-03 19:38:45 +02:00
[b]Note:[/b] Cannot be enabled if raw mode is on.
</member>
2019-06-29 12:38:01 +02:00
<member name= "presets_enabled" type= "bool" setter= "set_presets_enabled" getter= "are_presets_enabled" default= "true" >
2019-10-07 01:26:15 +02:00
If [code]true[/code], the "add preset" button is enabled.
2019-06-24 10:39:59 +02:00
</member>
2019-06-29 12:38:01 +02:00
<member name= "presets_visible" type= "bool" setter= "set_presets_visible" getter= "are_presets_visible" default= "true" >
2019-10-07 01:26:15 +02:00
If [code]true[/code], saved color presets are visible.
2019-06-24 10:39:59 +02:00
</member>
2019-06-29 12:38:01 +02:00
<member name= "raw_mode" type= "bool" setter= "set_raw_mode" getter= "is_raw_mode" default= "false" >
2018-12-20 13:46:54 +01:00
If [code]true[/code], 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).
2019-06-22 01:04:47 +02:00
[b]Note:[/b] Cannot be enabled if HSV mode is on.
2018-01-11 23:38:35 +01:00
</member>
</members>
2017-09-12 22:42:36 +02:00
<signals >
<signal name= "color_changed" >
2021-07-30 15:28:05 +02:00
<argument index= "0" name= "color" type= "Color" />
2017-09-12 22:42:36 +02:00
<description >
Emitted when the color is changed.
</description>
</signal>
2018-10-03 16:12:38 +02:00
<signal name= "preset_added" >
2021-07-30 15:28:05 +02:00
<argument index= "0" name= "color" type= "Color" />
2018-10-03 16:12:38 +02:00
<description >
Emitted when a preset is added.
</description>
</signal>
<signal name= "preset_removed" >
2021-07-30 15:28:05 +02:00
<argument index= "0" name= "color" type= "Color" />
2018-10-03 16:12:38 +02:00
<description >
Emitted when a preset is removed.
</description>
</signal>
</signals>
2017-09-12 22:42:36 +02:00
<constants >
</constants>
<theme_items >
2021-08-06 17:07:21 +02:00
<theme_item name= "h_width" data_type= "constant" type= "int" default= "30" >
2020-03-03 19:21:21 +01:00
The width of the hue selection slider.
2017-09-12 22:42:36 +02:00
</theme_item>
2021-08-06 17:07:21 +02:00
<theme_item name= "label_width" data_type= "constant" type= "int" default= "10" >
2017-09-12 22:42:36 +02:00
</theme_item>
2021-08-06 17:07:21 +02:00
<theme_item name= "margin" data_type= "constant" type= "int" default= "4" >
2020-03-03 19:21:21 +01:00
The margin around the [ColorPicker].
2017-09-12 22:42:36 +02:00
</theme_item>
2021-12-01 20:45:12 +01:00
<theme_item name= "sv_height" data_type= "constant" type= "int" default= "256" >
The height of the saturation-value selection box.
</theme_item>
<theme_item name= "sv_width" data_type= "constant" type= "int" default= "256" >
The width of the saturation-value selection box.
</theme_item>
<theme_item name= "add_preset" data_type= "icon" type= "Texture" >
The icon for the "Add Preset" button.
</theme_item>
<theme_item name= "color_hue" data_type= "icon" type= "Texture" >
Custom texture for the hue selection slider on the right.
</theme_item>
<theme_item name= "color_sample" data_type= "icon" type= "Texture" >
</theme_item>
2021-08-06 17:07:21 +02:00
<theme_item name= "overbright_indicator" data_type= "icon" type= "Texture" >
2020-03-03 19:21:21 +01:00
The indicator used to signalize that the color value is outside the 0-1 range.
2019-10-01 10:55:49 +02:00
</theme_item>
2021-08-06 17:07:21 +02:00
<theme_item name= "preset_bg" data_type= "icon" type= "Texture" >
2017-10-11 23:54:43 +02:00
</theme_item>
2021-08-06 17:07:21 +02:00
<theme_item name= "screen_picker" data_type= "icon" type= "Texture" >
2020-03-03 19:21:21 +01:00
The icon for the screen color picker button.
2017-09-12 22:42:36 +02:00
</theme_item>
</theme_items>
</class>