class

AColorPicker

Module
Arc
Header
#include "Arc/Widgets/AColorPicker.h"
Namespace
Arcf

Properties

TypeNameDescription
ArcDelegate<void(const ArcColor&)>OnColorChanged
ArcDelegate<void(bool)>OnClosedEnter -> OnClosed(true); Escape -> current color reverts to the original, then OnClosed(false). Hosts embed the picker and use this as the accept/cancel signal.

Public functions

ReturnsNameDescription
ARC_WIDGET_ARGS
ArcVec2ComputeDesiredSize
int32_tOnPaint
CReplyOnMouseButtonDown
CReplyOnMouseButtonUp
CReplyOnMouseMove
EArcCursorTypeOnCursorQuery
voidOnMouseCaptureLost
CReplyOnKeyDown
CReplyOnKeyChar
voidOnFocusLost
ArcColorGetColor
voidSetColor
voidSetOriginalColor
ArcColorGetOriginalColor
voidSetShowAlphaThe alpha row is a whole slider's worth of height.
boolIsHexEditing
voidSetEyedropperSamplerIn-window eyedropper: the host installs a sampler that resolves a window-space position to a color (the editor samples the rendered viewport).
uint32_tGetSavedColorsThe saved swatches are ONE process-wide palette — every picker shares it, so a colour saved while editing a light is offered in the material editor a minute later.
voidSetSavedColors
voidSetOnSavedColorsChanged
boolIsSrgbDisplayHow the NUMBERS are shown and parsed — the stored colour never changes.
voidSetSrgbDisplay
boolCanCacheDesiredSizeA fixed card whose height only depends on whether the alpha row is shown; the colour being edited never resizes it.
const char*GetTypeName

Function details

ARC_WIDGET_ARGS

C++
ARC_WIDGET_ARGS(AColorPicker) ARC_ATTR(ArcColor, InitialColor) ARC_ARG(bool, ShowAlpha) ARC_ARG(bool, DrawBackground) ARC_WIDGET_ARGS_END() void Construct(const CArguments& args)

ComputeDesiredSize

C++
ArcVec2 ComputeDesiredSize(float scale) const override

OnPaint

C++
int32_t OnPaint(const CArcPaintArgs& args, const CGeometry& geo, CArcUIRenderer& renderer, int32_t layerId) const override

OnMouseButtonDown

C++
CReply OnMouseButtonDown(const CGeometry& geo, const CPointerEvent& event) override

OnMouseButtonUp

C++
CReply OnMouseButtonUp(const CGeometry& geo, const CPointerEvent& event) override

OnMouseMove

C++
CReply OnMouseMove(const CGeometry& geo, const CPointerEvent& event) override

OnCursorQuery

C++
EArcCursorType OnCursorQuery(const CGeometry& geo, const CPointerEvent& event) const override

OnMouseCaptureLost

C++
void OnMouseCaptureLost() override

OnKeyDown

C++
CReply OnKeyDown(const CGeometry& geo, const CKeyEvent& event) override

OnKeyChar

C++
CReply OnKeyChar(const CGeometry& geo, const CCharacterEvent& event) override

OnFocusLost

C++
void OnFocusLost(const CFocusEvent& event) override

GetColor

C++
ArcColor GetColor() const

SetColor

C++
void SetColor(const ArcColor& color)

SetOriginalColor

C++
void SetOriginalColor(const ArcColor& color)

GetOriginalColor

C++
ArcColor GetOriginalColor() const

SetShowAlpha

C++
void SetShowAlpha(bool show)

The alpha row is a whole slider's worth of height.

IsHexEditing

C++
bool IsHexEditing() const

SetEyedropperSampler

C++
static void SetEyedropperSampler(std::function<bool(const ArcVec2&, ArcColor&)> sampler)

In-window eyedropper: the host installs a sampler that resolves a window-space position to a color (the editor samples the rendered viewport). Without a sampler the pipette button hides. While active the picker live-previews under the cursor; click commits, Escape restores the pre-activation color.

GetSavedColors

C++
static uint32_t GetSavedColors(std::array<ArcColor, 8>& out)

The saved swatches are ONE process-wide palette — every picker shares it, so a colour saved while editing a light is offered in the material editor a minute later. The host may persist it: Get/Set round-trip the palette and the callback fires after every user edit.

SetSavedColors

C++
static void SetSavedColors(const ArcColor* colors, uint32_t count)

SetOnSavedColorsChanged

C++
static void SetOnSavedColorsChanged(std::function<void()> callback)

IsSrgbDisplay

C++
static bool IsSrgbDisplay()

How the NUMBERS are shown and parsed — the stored colour never changes. Engine colours (light tint, base colour) are LINEAR, so their raw 0..255 reads much darker than the same colour in any other tool; sRGB mode gamma-encodes the hex and the R/G/B labels so a value can be copied in and out of one. Process-wide, like the saved palette: switching it in one picker switches it everywhere. Linear (raw) is the default — that is what every picker showed before the toggle existed.

SetSrgbDisplay

C++
static void SetSrgbDisplay(bool srgb)

CanCacheDesiredSize

C++
bool CanCacheDesiredSize() const override

A fixed card whose height only depends on whether the alpha row is shown; the colour being edited never resizes it.

GetTypeName

C++
const char* GetTypeName() const override
Generated from Arc/Widgets/AColorPicker.h via arc.json · Nov 5, 2026Version 1.0.0