ColorPicker

A full HSV picker that drops down from the control.

The smallest picker#

Luau
main:ColorPicker({
    Text = "ESP colour",
    Callback = function(colour)
        espColour = colour
    end,
})

colour is a Color3.

Preview

My Script

v1.0

ESP colour

Building it up#

Start on a colour:

Luau
main:ColorPicker({
    Text = "ESP colour",
    Default = Color3.fromRGB(90, 209, 122),
    Callback = setEspColour,
})

Open it immediately. Useful when the picker is the main thing on the page:

Luau
main:ColorPicker({
    Text = "ESP colour",
    Default = Color3.fromRGB(90, 209, 122),
    Open = true,
    Callback = setEspColour,
})

Apply the starting colour to your systems. A saved picker already calls Callback with the colour it restored, covered in Saving settings. FireOnStart does the same when nothing was saved:

Luau
main:ColorPicker({
    Text = "ESP colour",
    Default = Color3.fromRGB(90, 209, 122),
    Save = "espColour",
    FireOnStart = true,
    Callback = setEspColour,
})

Every option#

OptionTypeDefaultWhat it does
TextreqstringThe label.
Callbackfunction(Color3)Called as the colour changes, coalesced to one call per frame while dragging.
DefaultColor3 | tableStarting colour when nothing is saved. A { r = , g = , b = } table of 0-1 numbers works too. That is the saved form.
OpenbooleanfalseStart with the picker expanded.
FireOnStartbooleanfalseCall Callback once with the initial colour after the control builds.
DescriptionstringA quieter second line.
IconstringAn icon shown before the label.
Savestring | booleanPersist the colour under this key. true derives one from the section and label.
TooltipstringShown while the pointer is over the control.
DisabledbooleanfalseRefuses input and dims the control.
DisabledReasonstringShown as a tooltip while it is disabled.

Methods#

MethodReturnsWhat it does
Get()Color3The current colour
Set(colour)true, or false, reasonSets it and fires Callback. Takes a Color3 or a { r, g, b } table.
Open() / Close() / IsOpen()boolean from IsOpenControls the drop-down panel

Typing a hex value#

The closed control shows the current colour as #RRGGBB. The open panel has a field under the hue strip that takes the same form. Type six hex digits, with or without the #; it commits when the field loses focus. Anything else puts the previous colour back.

For a short fixed list of colours, use a Palette instead.