ColorPickerButton
Inherits: Button < BaseButton < Control < CanvasItem < Node < Object ColorPicker.
Description
ColorPicker making it accessible by pressing a button. Pressing the button will toggle the ColorPicker visibility. BaseButton which contains common properties and methods associated with this node. Note: By default, the button may not be wide enough for the color preview swatch to be visible. Make sure to set Control.rect_min_size to a big enough value to give the button enough space.
Tutorials
- GUI Drag And Drop Demo
- 2D GD Paint Demo
Properties
Methods
Theme Properties
Signals
- color_changed ( Color color ) Emitted when the color changes.
- picker_created ( ) ColorPicker is created (the button is pressed for the first time).
- popup_closed ( )
ColorPicker is closed.
Property Descriptions
- Color color The currently selected color.
- bool edit_alpha
true, the alpha channel in the displayed ColorPicker will be visible.Method Descriptions
- ColorPicker get_picker ( ) ColorPicker that this node toggles. Warning: This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their CanvasItem.visible property.
- PopupPanel get_popup ( )
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 node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their CanvasItem.visible property.
Theme Property Descriptions
- Texture bg The background of the color preview rect on the button.
- StyleBox disabled
StyleBox used when the
ColorPickerButtonis disabled.
- StyleBox focus
StyleBox used when the
ColorPickerButtonis focused. It is displayed over the current StyleBox, so using StyleBoxEmpty will just disable the focus visual effect.
- Font font
Font of the
ColorPickerButton‘s text.
- Color font_color
Color of the
ColorPickerButton.
- Color font_color_disabled
Color used when the
ColorPickerButtonis disabled.
- Color font_color_focus
Color used when the
ColorPickerButtonis focused. Only replaces the normal text color of the button. Disabled, hovered, and pressed states take precedence over this color.
- Color font_color_hover
Color used when the
ColorPickerButtonis being hovered.
- Color font_color_pressed
Color used when the
ColorPickerButtonis being pressed.
- StyleBox hover
StyleBox used when the
ColorPickerButtonis being hovered.
- int hseparation
ColorPickerButton‘s icon and text.
- StyleBox normal
StyleBox for the
ColorPickerButton.
- StyleBox pressed
StyleBox used when the
ColorPickerButtonis being pressed.
