ColorPicker
Color picker control.
Displays a color picker widget. Useful for selecting a color from an RGB/RGBA colorspace.
Note: This control is the color picker widget itself. You can use a instead if you need a button that brings up a in a pop-up.
Tutorials
Properties
void | add_preset ( color ) |
void | erase_preset ( color ) |
( ) const |
Theme Properties
| ||
| ||
| ||
| ||
Signals
Emitted when the color is changed.
- preset_added ( color )
Emitted when a preset is added.
- preset_removed ( Color color )
Emitted when a preset is removed.
- Color color
Default |
|
Setter | set_pick_color(value) |
Getter | get_pick_color() |
The currently selected color.
- deferred_mode
Default |
|
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).
- bool edit_alpha
If true
, shows an alpha channel slider (opacity).
- hsv_mode
Default |
|
Setter | set_hsv_mode(value) |
Getter | is_hsv_mode() |
Note: Cannot be enabled if raw mode is on.
- bool presets_enabled
Default | |
Setter | set_presets_enabled(value) |
Getter | are_presets_enabled() |
If true
, the “add preset” button is enabled.
- presets_visible
Default |
|
Setter | set_presets_visible(value) |
Getter | are_presets_visible() |
If true
, saved color presets are visible.
- bool raw_mode
Default |
|
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
- 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.
Removes the given color from the list of color presets of this color picker.
- get_presets ( ) const
Returns the list of colors in the presets of the color picker.
Theme Property Descriptions
- h_width
The width of the hue selection slider.
- int label_width
Default |
|
- margin
Default |
|
The margin around the ColorPicker
.
- int sv_height
Default |
The height of the saturation-value selection box.
- sv_width
Default |
|
The width of the saturation-value selection box.
- Texture add_preset
The icon for the “Add Preset” button.
- color_hue
Custom texture for the hue selection slider on the right.
- Texture color_sample
- overbright_indicator
- Texture screen_picker
The icon for the screen color picker button.