AROYN UI LIBRARY / UI COMPONENTS

ColorPicker

Choose an RGB color with an HSV popup and strict hex helpers.

Create ColorPicker#

Choose an RGB color with an HSV popup and strict hex helpers.

The constructor returns a ColorPicker handle. The snippet assumes section exists, as created in Quick start.

LUAU
local color = section:CreateColorPicker({
    Name = "Preview color", Flag = "preview-color",
    Default = Color3.fromRGB(164, 184, 169),
    Callback = function(value) print(value.R, value.G, value.B) end,
})
Open ColorPicker in Roblox showing saturation and value area, hue strip, hex #A4B8A9, RGB 164 184 169, and its preview trigger.Open full size ↗
Full popup with HSV controls, hex and RGB fields; the trigger below displays the same color.

Arguments#

OptionTypeDefaultMeaning
DefaultColor3Theme.Colors.TextInitial RGB color.
Callbackfunction(Color3)nilReceives the changed color.

Also accepts common options: Name, Description, Disabled and Callback; stateful controls additionally support Flag, Persist and Sensitive.

Manage state#

LUAU
color:SetValue(Color3.fromRGB(242, 242, 240))
local _, valid = color:SetHex("#A4B8A9", true)
assert(valid)
print(color:GetHex())
 color:Open()
color:Close()

Returned methods#

MethodReturnsBehavior
GetValue()Color3Current Color3 value.
SetValue(value, notify?)selfSilent by default; true calls Callback only after a changed normalized value.
SetDisabled(boolean)selfChanges user availability without discarding the value.
IsDisabled()booleanReads the requested disabled state.
Destroy()nilRemoves this control and its subscriptions; safe to repeat.
GetHex()stringUppercase #RRGGBB representation.
SetHex(string, notify?)self, valid:booleanThree or six hex digits, optional #; trims outer whitespace. Invalid value leaves state unchanged.
Open() / Close(instant?)selfPopup request/close, default instant=false.
IsOpen()booleanReads logical popup state.

Behavior and limitations#

There is no alpha channel, gradient API or live theme setter. Picking a color does not retheme an existing window automatically.

Color channels are compared with a 1e-7 tolerance. Configuration stores finite normalized RGB values in [0,1].

Shares popup arbitration with Dropdown. Mouse/touch drags cancel when input becomes unavailable; mobile rendering still requires a real device check.

Default and SetValue require Color3 with finite channels; invalid values assert. Runtime setters clamp channels to [0,1]. SetHex returns false for malformed or non-string input without changing the color; notify, when supplied, must be boolean.