Class ColorPicker
- Namespace
- Forma
- Assembly
- Forma.dll
HSV color editor with deterministic pointer and keyboard adjustment.
[TemplatePart("PART_ColorField", typeof(Control), true)]
public sealed class ColorPicker : TemplatedControl, IAddChild<Control>, IAddChild, INotifyPropertyChanged, IDisposable
- Inheritance
-
ColorPicker
- Implements
- Inherited Members
Constructors
ColorPicker()
public ColorPicker()
Fields
ColorFieldPartName
public const string ColorFieldPartName = "PART_ColorField"
Field Value
Properties
AccessibilityRole
public override AccessibilityRole AccessibilityRole { get; }
Property Value
CanAddSwatches
public bool CanAddSwatches { get; set; }
Property Value
Color
public Color Color { get; set; }
Property Value
- Color
ColorHtml
public string ColorHtml { get; set; }
Property Value
ColorMode
public ColorPickerMode ColorMode { get; set; }
Property Value
ColorizeSliders
public bool ColorizeSliders { get; set; }
Property Value
DeferredMode
public bool DeferredMode { get; set; }
Property Value
DisplayOldColor
public bool DisplayOldColor { get; set; }
Property Value
EditAlpha
public bool EditAlpha { get; set; }
Property Value
EditIntensity
public bool EditIntensity { get; set; }
Property Value
HexVisible
public bool HexVisible { get; set; }
Property Value
KeyboardAdjustmentStep
public float KeyboardAdjustmentStep { get; set; }
Property Value
ModesVisible
public bool ModesVisible { get; set; }
Property Value
OldColor
Previous color shown by a ColorPickerButton popup, equivalent to Godot's old_color.
public Color OldColor { get; set; }
Property Value
- Color
PickerShape
Interactive color surface layout, equivalent to Godot's picker_shape.
public ColorPickerShape PickerShape { get; set; }
Property Value
Presets
public IReadOnlyList<Color> Presets { get; }
Property Value
- IReadOnlyList<Color>
PresetsVisible
public bool PresetsVisible { get; set; }
Property Value
RecentPresets
Recently committed colors, maintained independently from persistent presets.
public IReadOnlyList<Color> RecentPresets { get; }
Property Value
- IReadOnlyList<Color>
SamplerVisible
public bool SamplerVisible { get; set; }
Property Value
SlidersVisible
public bool SlidersVisible { get; set; }
Property Value
Methods
AddPreset(Color)
Adds a preset, moving it to the back (most-recent position) if it already exists, matching Godot's ColorPicker::add_preset.
public void AddPreset(Color color)
Parameters
colorColor
AddRecentPreset(Color)
Adds a unique recent swatch, retaining Godot's nine-color recent history limit.
public void AddRecentPreset(Color color)
Parameters
colorColor
AreModesVisible()
public bool AreModesVisible()
Returns
ArePresetsVisible()
public bool ArePresetsVisible()
Returns
AreSlidersVisible()
public bool AreSlidersVisible()
Returns
AreSwatchesEnabled()
public bool AreSwatchesEnabled()
Returns
ClearPresets()
public void ClearPresets()
ClearRecentPresets()
public void ClearRecentPresets()
Commit()
public void Commit()
ErasePreset(Color)
public bool ErasePreset(Color color)
Parameters
colorColor
Returns
EraseRecentPreset(Color)
public bool EraseRecentPreset(Color color)
Parameters
colorColor
Returns
GetChannelLabel(int)
Returns the mode-specific label for a visible color channel.
public string GetChannelLabel(int channel)
Parameters
channelint
Returns
GetChannelMaximum(int)
Returns the upper bound used by Godot's selected ColorPicker channel mode.
public float GetChannelMaximum(int channel)
Parameters
channelint
Returns
GetChannelValue(int)
Reads a selected ColorPicker mode channel using Godot's displayed units.
public float GetChannelValue(int channel)
Parameters
channelint
Returns
GetColorMode()
public ColorPickerMode GetColorMode()
Returns
GetHsv()
Gets hue, saturation and value in normalized 0..1 units.
public Vector3 GetHsv()
Returns
- Vector3
GetOkHsl()
Gets the Godot ColorPicker OKHSL channel values in normalized 0..1 units.
public Vector3 GetOkHsl()
Returns
- Vector3
GetOldColor()
public Color GetOldColor()
Returns
- Color
GetPickColor()
public Color GetPickColor()
Returns
- Color
GetPickerCursorNormalized()
public Vector2 GetPickerCursorNormalized()
Returns
- Vector2
GetPickerShape()
public ColorPickerShape GetPickerShape()
Returns
IsColorizingSliders()
public bool IsColorizingSliders()
Returns
IsDeferredMode()
public bool IsDeferredMode()
Returns
IsDisplayingOldColor()
public bool IsDisplayingOldColor()
Returns
IsEditingAlpha()
public bool IsEditingAlpha()
Returns
IsEditingIntensity()
public bool IsEditingIntensity()
Returns
IsHexVisible()
public bool IsHexVisible()
Returns
IsSamplerVisible()
public bool IsSamplerVisible()
Returns
SelectPreset(int)
public void SelectPreset(int index)
Parameters
indexint
SelectRecentPreset(int)
public void SelectRecentPreset(int index)
Parameters
indexint
SetCanAddSwatches(bool)
public void SetCanAddSwatches(bool enabled)
Parameters
enabledbool
SetChannelValue(int, float)
Updates one selected ColorPicker mode channel using Godot's displayed units.
public void SetChannelValue(int channel, float value)
Parameters
SetColorMode(ColorPickerMode)
public void SetColorMode(ColorPickerMode mode)
Parameters
modeColorPickerMode
SetColorizeSliders(bool)
public void SetColorizeSliders(bool enabled)
Parameters
enabledbool
SetDeferredMode(bool)
public void SetDeferredMode(bool enabled)
Parameters
enabledbool
SetDisplayOldColor(bool)
public void SetDisplayOldColor(bool enabled)
Parameters
enabledbool
SetEditAlpha(bool)
public void SetEditAlpha(bool show)
Parameters
showbool
SetEditIntensity(bool)
public void SetEditIntensity(bool show)
Parameters
showbool
SetHexVisible(bool)
public void SetHexVisible(bool visible)
Parameters
visiblebool
SetHsv(float, float, float, float?)
public void SetHsv(float hue, float saturation, float value, float? alpha = null)
Parameters
SetModesVisible(bool)
public void SetModesVisible(bool visible)
Parameters
visiblebool
SetOkHsl(float, float, float, float?)
Sets the color from Godot's perceptually uniform OKHSL representation.
public void SetOkHsl(float hue, float saturation, float lightness, float? alpha = null)
Parameters
SetOldColor(Color)
public void SetOldColor(Color color)
Parameters
colorColor
SetPickColor(Color)
public void SetPickColor(Color color)
Parameters
colorColor
SetPickerCursorNormalized(Vector2)
public void SetPickerCursorNormalized(Vector2 cursor)
Parameters
cursorVector2
SetPickerShape(ColorPickerShape)
public void SetPickerShape(ColorPickerShape shape)
Parameters
shapeColorPickerShape
SetPresets(IEnumerable<Color>)
public void SetPresets(IEnumerable<Color> colors)
Parameters
colorsIEnumerable<Color>
SetPresetsVisible(bool)
public void SetPresetsVisible(bool visible)
Parameters
visiblebool
SetSamplerVisible(bool)
public void SetSamplerVisible(bool visible)
Parameters
visiblebool
SetSlidersVisible(bool)
public void SetSlidersVisible(bool visible)
Parameters
visiblebool
Events
ColorChanged
public event Action<ColorPicker, Color> ColorChanged
Event Type
- Action<ColorPicker, Color>
PresetSelected
public event Action<ColorPicker, Color> PresetSelected
Event Type
- Action<ColorPicker, Color>
RecentPresetSelected
public event Action<ColorPicker, Color> RecentPresetSelected
Event Type
- Action<ColorPicker, Color>