Color picker control.
    public class ColorPicker : BoxContainer

Control node displaying a color picker widget. It’s useful for selecting a color from an RGB/RGBA colorspace.

Inheritance Chain

Constructors

    public ColorPicker()

Signals

    "color_changed" (Color color)

Emitted when the color is changed.

    "preset_added" (Color color)

Emitted when a preset is added.

    "preset_removed" (Color color)

Emitted when a preset is removed.

Properties

    public Color Color { get; set; }

The currently selected color.

    public bool DeferredMode { get; set; }

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).

    public bool EditAlpha { get; set; }

If true, shows an alpha channel slider (transparency).

    public bool RawMode { get; set; }

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).

Methods

    public void AddPreset(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.

    public void ErasePreset(Color color)

Remove the given color from the list of color presets of this color picker.

    public Color GetPickColor()

Getter for Color

    public Color[] GetPresets()

Return the list of colors in the presets of the color picker.

    public bool IsDeferredMode()

Getter for DeferredMode

    public bool IsEditingAlpha()

Getter for EditAlpha

    public bool IsRawMode()

Getter for RawMode

    public void SetDeferredMode(bool mode)

Setter for DeferredMode

    public void SetEditAlpha(bool show)

Setter for EditAlpha

    public void SetPickColor(Color color)

Setter for Color

    public void SetRawMode(bool mode)

Setter for RawMode

Tags: