reckfellENGINE

ColorPicker

Embedded color editing panel with editing modes, presets and a separate recent-color history.

On this page
class ColorPickerReckfellSharpInherits VBoxContainer

ColorPicker is the panel itself, without a separate popup or OK/cancel result. Embed it in your interface or use ColorPickerButton for a ready-made button and window. Set the value through Color and receive user edits through ColorChanged. The programmatic Color setter emits no signal; call your model update explicitly from code.

ColorMode selects the component representation; PickerShape selects the picking area shape. They are separate settings and switching them does not convert the stored value. Choose RGB/HSV/Linear/OKHSL for the user’s task; changing mode does not set the project or texture color space.

EditAlpha and EditIntensity control editing rather than clearing components: hiding alpha retains transparency, and disabling intensity does not clamp an assigned HDR color. SlidersVisible, HexVisible, ColorModesVisible, PresetsVisible and SamplerVisible hide their UI sections without deleting the color or presets. HexVisible concerns the text-input section rather than the storage format.

DeferredMode postpones drag notifications until the gesture ends; the internal color/preview can change earlier. This is not a transaction, asynchronous task or confirmation. Text entry and preset selection need not wait for a drag to end. For your own Apply/Cancel flow, retain the original color and control writes to the model separately.

AddPreset adds a unique color to the palette; adding it again moves it to the end. ErasePreset removes the matching value. These programmatic operations emit neither PresetAdded nor PresetRemoved: those signals concern UI actions. Persist the palette yourself if it must survive an application restart; the control’s list is not project storage. GetPresets and GetRecentPresets return Color[] snapshots; editing them does not change the palette.

Recent colors are a separate bounded history. AddRecentPreset for an existing color can change the current color and emit ColorChanged through internal swatch selection; do not assume it is always a silent history write. Do not rely on stable indices, history capacity or visual button order. Keep your own list for an exact controlled history. CanAddSwatches = false disables user addition/removal rather than prohibiting AddPreset/ErasePreset calls from code.

The eyedropper depends on the platform, permissions and available screen-capture method. Showing its UI does not guarantee reading colors from other applications. Do not start screen picking automatically when creating the panel.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

ColorPickerConstructor
# ColorPicker
C#
public ColorPicker();

Creates a panel with white color, RGB mode, HsvRectangle shape, editing UI enabled and DeferredMode = false.

Properties12

CanAddSwatchesProperty
# CanAddSwatches
C#
public bool CanAddSwatches { get; set; }

Allows user addition and removal of swatches, default true. Does not make Color read-only or block programmatic palette methods.

ColorProperty
# Color
C#
public Color Color { get; set; }

Current Color value including alpha and HDR components. Programmatic assignment updates the panel without ColorChanged. A value rather than confirmation or an automatic material write.

ColorModeProperty
# ColorMode
C#
public ColorPicker.ColorModeType ColorMode { get; set; }

Component representation: Rgb, Hsv, Linear or Okhsl. Default Rgb. Switching retains Color rather than setting the project color space. Use Linear instead of legacy Raw.

ColorModesVisibleProperty
# ColorModesVisible
C#
public bool ColorModesVisible { get; set; }

Show mode-switching UI, default true. false neither changes the current ColorMode nor blocks its programmatic setter.

DeferredModeProperty
# DeferredMode
C#
public bool DeferredMode { get; set; }

Postpone drag ColorChanged notifications until release, default false. Color can change during dragging; this provides neither rollback nor general suppression of text/preset signals. Programmatic Color remains silent.

EditAlphaProperty
# EditAlpha
C#
public bool EditAlpha { get; set; }

Enables alpha editing, default true. false hides alpha controls while retaining the current transparency.

EditIntensityProperty
# EditIntensity
C#
public bool EditIntensity { get; set; }

Enables separate intensity editing, default true. false neither clamps stored HDR components to 1 nor disables scene glow.

HexVisibleProperty
# HexVisible
C#
public bool HexVisible { get; set; }

Show the color text-input section, default true. UI visibility rather than forcing HEX storage of Color.

PickerShapeProperty
# PickerShape
C#
public ColorPicker.PickerShapeType PickerShape { get; set; }

Picking area shape, default HsvRectangle. None hides the area and shape-selection button rather than removing Color or other editing controls.

PresetsVisibleProperty
# PresetsVisible
C#
public bool PresetsVisible { get; set; }

Show palette and recent-color sections, default true. false retains the lists and access through GetPresets/GetRecentPresets.

SamplerVisibleProperty
# SamplerVisible
C#
public bool SamplerVisible { get; set; }

Show the sample/eyedropper section, default true. Does not start screen capture or guarantee permissions/platform support.

SlidersVisibleProperty
# SlidersVisible
C#
public bool SlidersVisible { get; set; }

Show the component-slider section, default true. Hiding it does not change Color.

Methods30

AddPresetvoid
# AddPreset
C#
public void AddPreset(Color color);

Adds a palette color; an exact duplicate moves the existing swatch to the end without duplication. Does not change Color or emit PresetAdded. Works with CanAddSwatches = false; implement persistence separately.

Parameters
NameTypeDefault
colorColor—
color

Color value with alpha; swatch equality includes all components.

AddRecentPresetvoid
# AddRecentPreset
C#
public void AddRecentPreset(Color color);

Adds a color to bounded recent history. Repeating an existing swatch can move it to the end, select that color and emit ColorChanged through an internal handler. Not a guaranteed silent history write.

Parameters
NameTypeDefault
colorColor—
color

Color value with alpha; swatch equality includes all components.

AreModesVisiblebool
# AreModesVisible
C#
public bool AreModesVisible();

Show mode-switching UI, default true. false neither changes the current ColorMode nor blocks its programmatic setter.

Returns bool

Show mode-switching UI, default true. false neither changes the current ColorMode nor blocks its programmatic setter.

ArePresetsVisiblebool
# ArePresetsVisible
C#
public bool ArePresetsVisible();

Show palette and recent-color sections, default true. false retains the lists and access through GetPresets/GetRecentPresets.

Returns bool

Show palette and recent-color sections, default true. false retains the lists and access through GetPresets/GetRecentPresets.

AreSlidersVisiblebool
# AreSlidersVisible
C#
public bool AreSlidersVisible();

Show the component-slider section, default true. Hiding it does not change Color.

Returns bool

Show the component-slider section, default true. Hiding it does not change Color.

AreSwatchesEnabledbool
# AreSwatchesEnabled
C#
public bool AreSwatchesEnabled();

Allows user addition and removal of swatches, default true. Does not make Color read-only or block programmatic palette methods.

Returns bool

Allows user addition and removal of swatches, default true. Does not make Color read-only or block programmatic palette methods.

ErasePresetvoid
# ErasePreset
C#
public void ErasePreset(Color color);

Removes a matching palette color; missing values are ignored. Emits no PresetRemoved; CanAddSwatches does not prohibit programmatic removal.

Parameters
NameTypeDefault
colorColor—
color

Color value with alpha; swatch equality includes all components.

EraseRecentPresetvoid
# EraseRecentPreset
C#
public void EraseRecentPreset(Color color);

Removes a matching recent-history value; missing values are ignored. Emits no PresetRemoved; this list is separate from the palette.

Parameters
NameTypeDefault
colorColor—
color

Color value with alpha; swatch equality includes all components.

GetColorModeColorPicker.ColorModeType
# GetColorMode
C#
public ColorPicker.ColorModeType GetColorMode();

Component representation: Rgb, Hsv, Linear or Okhsl. Default Rgb. Switching retains Color rather than setting the project color space. Use Linear instead of legacy Raw.

Returns ColorPicker.ColorModeType

Component representation: Rgb, Hsv, Linear or Okhsl. Default Rgb. Switching retains Color rather than setting the project color space. Use Linear instead of legacy Raw.

GetPickColorColor
# GetPickColor
C#
public Color GetPickColor();

Current Color value including alpha and HDR components. Programmatic assignment updates the panel without ColorChanged. A value rather than confirmation or an automatic material write.

Returns Color

Current Color value including alpha and HDR components. Programmatic assignment updates the panel without ColorChanged. A value rather than confirmation or an automatic material write.

GetPickerShapeColorPicker.PickerShapeType
# GetPickerShape
C#
public ColorPicker.PickerShapeType GetPickerShape();

Picking area shape, default HsvRectangle. None hides the area and shape-selection button rather than removing Color or other editing controls.

Returns ColorPicker.PickerShapeType

Picking area shape, default HsvRectangle. None hides the area and shape-selection button rather than removing Color or other editing controls.

GetPresetsColor[]
# GetPresets
C#
public Color[] GetPresets();

Returns an independent Color[] in palette-list order. Editing the array does not change the control. Indices can change after additions/removals/repeated colors.

Returns Color[]

Returns an independent Color[] in palette-list order. Editing the array does not change the control. Indices can change after additions/removals/repeated colors.

GetRecentPresetsColor[]
# GetRecentPresets
C#
public Color[] GetRecentPresets();

Returns an independent history Color[], not a guaranteed visual button order. History is bounded and does not replace application palette persistence.

Returns Color[]

Returns an independent history Color[], not a guaranteed visual button order. History is bounded and does not replace application palette persistence.

IsDeferredModebool
# IsDeferredMode
C#
public bool IsDeferredMode();

Postpone drag ColorChanged notifications until release, default false. Color can change during dragging; this provides neither rollback nor general suppression of text/preset signals. Programmatic Color remains silent.

Returns bool

Postpone drag ColorChanged notifications until release, default false. Color can change during dragging; this provides neither rollback nor general suppression of text/preset signals. Programmatic Color remains silent.

IsEditingAlphabool
# IsEditingAlpha
C#
public bool IsEditingAlpha();

Enables alpha editing, default true. false hides alpha controls while retaining the current transparency.

Returns bool

Enables alpha editing, default true. false hides alpha controls while retaining the current transparency.

IsEditingIntensitybool
# IsEditingIntensity
C#
public bool IsEditingIntensity();

Enables separate intensity editing, default true. false neither clamps stored HDR components to 1 nor disables scene glow.

Returns bool

Enables separate intensity editing, default true. false neither clamps stored HDR components to 1 nor disables scene glow.

IsHexVisiblebool
# IsHexVisible
C#
public bool IsHexVisible();

Show the color text-input section, default true. UI visibility rather than forcing HEX storage of Color.

Returns bool

Show the color text-input section, default true. UI visibility rather than forcing HEX storage of Color.

IsSamplerVisiblebool
# IsSamplerVisible
C#
public bool IsSamplerVisible();

Show the sample/eyedropper section, default true. Does not start screen capture or guarantee permissions/platform support.

Returns bool

Show the sample/eyedropper section, default true. Does not start screen capture or guarantee permissions/platform support.

SetCanAddSwatchesvoid
# SetCanAddSwatches
C#
public void SetCanAddSwatches(bool enabled);

Allows user addition and removal of swatches, default true. Does not make Color read-only or block programmatic palette methods.

Parameters
NameTypeDefault
enabledbool—
enabled

Allows user addition and removal of swatches, default true. Does not make Color read-only or block programmatic palette methods.

SetColorModevoid
# SetColorMode
C#
public void SetColorMode(ColorPicker.ColorModeType colorMode);

Component representation: Rgb, Hsv, Linear or Okhsl. Default Rgb. Switching retains Color rather than setting the project color space. Use Linear instead of legacy Raw.

Parameters
NameTypeDefault
colorModeColorPicker.ColorModeType—
colorMode

Valid ColorModeType; use Linear rather than Raw.

SetDeferredModevoid
# SetDeferredMode
C#
public void SetDeferredMode(bool mode);

Postpone drag ColorChanged notifications until release, default false. Color can change during dragging; this provides neither rollback nor general suppression of text/preset signals. Programmatic Color remains silent.

Parameters
NameTypeDefault
modebool—
mode

Postpone drag ColorChanged notifications until release, default false. Color can change during dragging; this provides neither rollback nor general suppression of text/preset signals. Programmatic Color remains silent.

SetEditAlphavoid
# SetEditAlpha
C#
public void SetEditAlpha(bool show);

Enables alpha editing, default true. false hides alpha controls while retaining the current transparency.

Parameters
NameTypeDefault
showbool—
show

Enables alpha editing, default true. false hides alpha controls while retaining the current transparency.

SetEditIntensityvoid
# SetEditIntensity
C#
public void SetEditIntensity(bool show);

Enables separate intensity editing, default true. false neither clamps stored HDR components to 1 nor disables scene glow.

Parameters
NameTypeDefault
showbool—
show

Enables separate intensity editing, default true. false neither clamps stored HDR components to 1 nor disables scene glow.

SetHexVisiblevoid
# SetHexVisible
C#
public void SetHexVisible(bool visible);

Show the color text-input section, default true. UI visibility rather than forcing HEX storage of Color.

Parameters
NameTypeDefault
visiblebool—
visible

Show the color text-input section, default true. UI visibility rather than forcing HEX storage of Color.

SetModesVisiblevoid
# SetModesVisible
C#
public void SetModesVisible(bool visible);

Show mode-switching UI, default true. false neither changes the current ColorMode nor blocks its programmatic setter.

Parameters
NameTypeDefault
visiblebool—
visible

Show mode-switching UI, default true. false neither changes the current ColorMode nor blocks its programmatic setter.

SetPickColorvoid
# SetPickColor
C#
public void SetPickColor(Color color);

Current Color value including alpha and HDR components. Programmatic assignment updates the panel without ColorChanged. A value rather than confirmation or an automatic material write.

Parameters
NameTypeDefault
colorColor—
color

Color value with alpha; swatch equality includes all components.

SetPickerShapevoid
# SetPickerShape
C#
public void SetPickerShape(ColorPicker.PickerShapeType shape);

Picking area shape, default HsvRectangle. None hides the area and shape-selection button rather than removing Color or other editing controls.

Parameters
NameTypeDefault
shapeColorPicker.PickerShapeType—
shape

Valid PickerShapeType; None hides the picking area.

SetPresetsVisiblevoid
# SetPresetsVisible
C#
public void SetPresetsVisible(bool visible);

Show palette and recent-color sections, default true. false retains the lists and access through GetPresets/GetRecentPresets.

Parameters
NameTypeDefault
visiblebool—
visible

Show palette and recent-color sections, default true. false retains the lists and access through GetPresets/GetRecentPresets.

SetSamplerVisiblevoid
# SetSamplerVisible
C#
public void SetSamplerVisible(bool visible);

Show the sample/eyedropper section, default true. Does not start screen capture or guarantee permissions/platform support.

Parameters
NameTypeDefault
visiblebool—
visible

Show the sample/eyedropper section, default true. Does not start screen capture or guarantee permissions/platform support.

SetSlidersVisiblevoid
# SetSlidersVisible
C#
public void SetSlidersVisible(bool visible);

Show the component-slider section, default true. Hiding it does not change Color.

Parameters
NameTypeDefault
visiblebool—
visible

Show the component-slider section, default true. Hiding it does not change Color.

Signals and events3

ColorChangedEvent
# ColorChanged
C#
public event ColorPicker.ColorChangedEventHandler ColorChanged;

Change from interactive editing; programmatic Color does not emit it. Can also arrive through internal selection on repeated AddRecentPreset. DeferredMode delays drag notifications rather than confirming a choice.

Handler parameters
NameTypeDefault
colorColor—
color

Color value with alpha; swatch equality includes all components.

PresetAddedEvent
# PresetAdded
C#
public event ColorPicker.PresetAddedEventHandler PresetAdded;

The user added a palette swatch through the UI. Direct AddPreset does not emit this signal; explicitly call your persistence logic for code-driven changes.

Handler parameters
NameTypeDefault
colorColor—
color

Color value with alpha; swatch equality includes all components.

PresetRemovedEvent
# PresetRemoved
C#
public event ColorPicker.PresetRemovedEventHandler PresetRemoved;

The user removed a swatch through the UI with CanAddSwatches allowed. Direct ErasePreset/EraseRecentPreset calls do not emit it.

Handler parameters
NameTypeDefault
colorColor—
color

Color value with alpha; swatch equality includes all components.

ColorPicker.ColorModeType

ValueDescription
Hsv = 1

Allows editing the color with Hue/Saturation/Value sliders.

Linear = 2

Allows editing the color with Red/Green/Blue sliders in linear color space.

Okhsl = 3

Allows editing the color with Hue/Saturation/Lightness sliders. OKHSL is a new color space similar to HSL but that better match perception by leveraging the Oklab color space which is designed to be simple to use, while doing a good job at predicting perceived lightness, chroma and hue. Okhsv and Okhsl color spaces

Raw = 2
Rgb = 0

Allows editing the color with Red/Green/Blue sliders in sRGB color space.

ColorPicker.PickerShapeType

ValueDescription
HsvRectangle = 0

HSV Color Model rectangle color space.

HsvWheel = 1

HSV Color Model rectangle color space with a wheel.

None = 4

The color space shape and the shape select button are hidden. Can't be selected from the shapes popup.

OkHlRectangle = 6

OKHSL Color Model rectangle with constant saturation.

OkHsRectangle = 5

OKHSL Color Model rectangle with constant lightness.

OkhslCircle = 3

HSL OK Color Model circle color space.

VhsCircle = 2

HSV Color Model circle color space. Use Saturation as a radius.

Theme properties

These are Theme resource keys, not C# properties. Use the matching Control GetTheme…() and AddTheme…Override() methods for each value type.

Key and typeDescription
focused_not_editing_cursor_color
Color

Color of rectangle or circle drawn when a picker shape part is focused but not editable via keyboard or joypad. Displayed over the picker shape, so a partially transparent color should be used to ensure the picker shape remains visible.

Default: Color(1, 1, 1, 0.275)
center_slider_grabbers
int

Overrides the Slider.center_grabber theme property of the sliders.

Default: 1
h_width
int

The width of the hue selection slider.

Default: 30
label_width
int

The minimum width of the color labels next to sliders.

Default: 10
margin
int

The margin around the ColorPicker.

Default: 4
sv_height
int

The height of the saturation-value selection box.

Default: 256
sv_width
int

The width of the saturation-value selection box.

Default: 256
add_preset
Texture2D

The icon for the "Add Preset" button.

bar_arrow
Texture2D

The texture for the arrow grabber.

color_copy
Texture2D

The icon for the button that copies the color in text format to the clipboard.

color_hue
Texture2D

Custom texture for the hue selection slider on the right.

color_script
Texture2D

The icon for the button that switches color text to hexadecimal.

expanded_arrow
Texture2D

The icon for color preset drop down menu when expanded.

folded_arrow
Texture2D

The icon for color preset drop down menu when folded.

menu_option
Texture2D

The icon for color preset option menu.

overbright_indicator
Texture2D

The indicator used to signalize that the color value is outside the 0-1 range.

picker_cursor
Texture2D

The image displayed over the color box/circle (depending on the ColorPicker.PickerShape), marking the currently selected color.

picker_cursor_bg
Texture2D

The fill image displayed behind the picker cursor.

sample_bg
Texture2D

Background panel for the color preview box (visible when the color is translucent).

sample_revert
Texture2D

The icon for the revert button (visible on the middle of the "old" color when it differs from the currently selected color). This icon is modulated with a dark color if the "old" color is bright enough, so the icon should be bright to ensure visibility in both scenarios.

screen_picker
Texture2D

The icon for the screen color picker button.

shape_circle
Texture2D

The icon for circular picker shapes.

shape_rect
Texture2D

The icon for rectangular picker shapes.

shape_rect_wheel
Texture2D

The icon for rectangular wheel picker shapes.

picker_focus_circle
StyleBox

The StyleBox used when the circle-shaped part of the picker is focused. Displayed over the picker shape, so a partially transparent StyleBox should be used to ensure the picker shape remains visible. A StyleBox that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a StyleBoxEmpty resource. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons.

picker_focus_rectangle
StyleBox

The StyleBox used when the rectangle-shaped part of the picker is focused. Displayed over the picker shape, so a partially transparent StyleBox should be used to ensure the picker shape remains visible. A StyleBox that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a StyleBoxEmpty resource. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons.

sample_focus
StyleBox

The StyleBox used for the old color sample part when it is focused. Displayed over the sample, so a partially transparent StyleBox should be used to ensure the picker shape remains visible. A StyleBox that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a StyleBoxEmpty resource. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.