ColorPickerButton
Inherits: Button < BaseButton < Control < CanvasItem < Actor < Object
A button that brings up a ColorPicker when pressed.
Description
Section titled “Description”Encapsulates a ColorPicker, making it accessible by pressing a button. Pressing the button will toggle the ColorPicker’s visibility.
See also BaseButton which contains common properties and methods associated with this actor.
Note: By default, the button may not be wide enough for the color preview swatch to be visible. Make sure to set Control.custom_minimum_size to a big enough value to give the button enough space.
Properties
Section titled “Properties”| Type | Name | Default |
|---|---|---|
| Color | color | Color(0, 0, 0, 1) |
| bool | edit_alpha | true |
| bool | edit_intensity | true |
| bool | toggle_mode | true |
Methods
Section titled “Methods”| Returns | Method |
|---|---|
| ColorPicker | get_picker() |
| PopupPanel | get_popup() |
Signals
Section titled “Signals”color_changed
Section titled “color_changed”color_changed(color: Color)Emitted when the color changes.
picker_created
Section titled “picker_created”picker_created()Emitted when the ColorPicker is created (the button is pressed for the first time).
popup_closed
Section titled “popup_closed”popup_closed()Emitted when the ColorPicker is closed.
Property descriptions
Section titled “Property descriptions”Color color = Color(0, 0, 0, 1)
Setter/getter: set_pick_color(), get_pick_color()
The currently selected color.
edit_alpha
Section titled “edit_alpha”bool edit_alpha = true
Setter/getter: set_edit_alpha(), is_editing_alpha()
If true, the alpha channel in the displayed ColorPicker will be visible.
edit_intensity
Section titled “edit_intensity”bool edit_intensity = true
Setter/getter: set_edit_intensity(), is_editing_intensity()
If true, the intensity slider in the displayed ColorPicker will be visible.
toggle_mode
Section titled “toggle_mode”bool toggle_mode = true
Setter/getter: set_toggle_mode(), is_toggle_mode()
No description yet.
Method descriptions
Section titled “Method descriptions”get_picker
Section titled “get_picker”ColorPicker get_picker()
Returns the ColorPicker that this actor toggles.
Warning: This is a required internal actor, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their CanvasItem.visible property.
get_popup
Section titled “get_popup”PopupPanel get_popup()
Returns the control’s PopupPanel which allows you to connect to popup signals. This allows you to handle events when the ColorPicker is shown or hidden.
Warning: This is a required internal actor, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their Window.visible property.