summaryrefslogtreecommitdiff
path: root/doc/classes/ColorPicker.xml
blob: cd36f4fdf0ab78074f6a3791d3f4a1a17a0cc459 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<?xml version="1.0" encoding="UTF-8" ?>
<class name="ColorPicker" inherits="BoxContainer" category="Core" version="3.2">
	<brief_description>
		Color picker control.
	</brief_description>
	<description>
		[Control] node displaying a color picker widget. It's useful for selecting a color from an RGB/RGBA colorspace.
	</description>
	<tutorials>
	</tutorials>
	<methods>
		<method name="add_preset">
			<return type="void">
			</return>
			<argument index="0" name="color" type="Color">
			</argument>
			<description>
				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.
				[b]Note:[/b] the presets list is only for [i]this[/i] color picker.
			</description>
		</method>
		<method name="erase_preset">
			<return type="void">
			</return>
			<argument index="0" name="color" type="Color">
			</argument>
			<description>
				Removes the given color from the list of color presets of this color picker.
			</description>
		</method>
		<method name="get_presets" qualifiers="const">
			<return type="PoolColorArray">
			</return>
			<description>
				Returns the list of colors in the presets of the color picker.
			</description>
		</method>
	</methods>
	<members>
		<member name="color" type="Color" setter="set_pick_color" getter="get_pick_color" default="Color( 1, 1, 1, 1 )">
			The currently selected color.
		</member>
		<member name="deferred_mode" type="bool" setter="set_deferred_mode" getter="is_deferred_mode" default="false">
			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).
		</member>
		<member name="edit_alpha" type="bool" setter="set_edit_alpha" getter="is_editing_alpha" default="true">
			If [code]true[/code], shows an alpha channel slider (transparency).
		</member>
		<member name="hsv_mode" type="bool" setter="set_hsv_mode" getter="is_hsv_mode" default="false">
			If [code]true[/code], allows editing the color with Hue/Saturation/Value sliders.
			[b]Note:[/b] Cannot be enabled if raw mode is on.
		</member>
		<member name="presets_enabled" type="bool" setter="set_presets_enabled" getter="are_presets_enabled" default="true">
		</member>
		<member name="presets_visible" type="bool" setter="set_presets_visible" getter="are_presets_visible" default="true">
		</member>
		<member name="raw_mode" type="bool" setter="set_raw_mode" getter="is_raw_mode" default="false">
			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).
			[b]Note:[/b] Cannot be enabled if HSV mode is on.
		</member>
	</members>
	<signals>
		<signal name="color_changed">
			<argument index="0" name="color" type="Color">
			</argument>
			<description>
				Emitted when the color is changed.
			</description>
		</signal>
		<signal name="preset_added">
			<argument index="0" name="color" type="Color">
			</argument>
			<description>
				Emitted when a preset is added.
			</description>
		</signal>
		<signal name="preset_removed">
			<argument index="0" name="color" type="Color">
			</argument>
			<description>
				Emitted when a preset is removed.
			</description>
		</signal>
	</signals>
	<constants>
	</constants>
	<theme_items>
		<theme_item name="add_preset" type="Texture">
		</theme_item>
		<theme_item name="color_hue" type="Texture">
		</theme_item>
		<theme_item name="color_sample" type="Texture">
		</theme_item>
		<theme_item name="h_width" type="int" default="30">
		</theme_item>
		<theme_item name="label_width" type="int" default="10">
		</theme_item>
		<theme_item name="margin" type="int" default="4">
		</theme_item>
		<theme_item name="overbright_indicator" type="Texture">
		</theme_item>
		<theme_item name="preset_bg" type="Texture">
		</theme_item>
		<theme_item name="screen_picker" type="Texture">
		</theme_item>
		<theme_item name="sv_height" type="int" default="256">
		</theme_item>
		<theme_item name="sv_width" type="int" default="256">
		</theme_item>
	</theme_items>
</class>