Skip to content

ColorPicker

donniedice edited this page May 1, 2026 · 4 revisions

ColorPicker Widget

The ColorPicker module (RGXColorPicker) is a custom rectangular HSV color picker introduced in v2.0.0, replacing WoW's default circular picker with a Figma-style interface.


Features

  • Rectangular SV (Saturation-Value) box — drag to select saturation and brightness
  • Hue bar — vertical slider for hue selection
  • RGB inputs — numeric fields for precise RGB values
  • HEX input — text field for hex color entry
  • 4 palettes — Recent, Class, Quality, Basic color swatches
  • History — recent colors are saved and displayed
  • Alpha support — opacity slider

API

ColorPicker:Show(r, g, b, a, callback)

Show the color picker with an initial color:

RGX:GetColorPicker():Show(0.5, 0.2, 0.8, 1.0, function(r, g, b, a)
    print(string.format("Selected: %.2f, %.2f, %.2f, %.2f", r, g, b, a))
end)

ColorPicker:Hide()

Hide the color picker programmatically.

ColorPicker:Get()r, g, b, a

Get the current color values:

local r, g, b, a = RGX:GetColorPicker():Get()

ColorPicker:Set(r, g, b, a)

Set the color programmatically. Updates all UI elements:

RGX:GetColorPicker():Set(1.0, 0.0, 0.0, 1.0)

ColorPicker:OnClose(callback)

Register a callback for when the picker is closed:

RGX:GetColorPicker():OnClose(function(r, g, b, a)
    print("Final color:", r, g, b, a)
end)

Palette Tabs

Tab Contents
Recent Last 16 colors selected
Class All 13 class colors
Quality Item quality colors (Poor through Heirloom)
Basic Named palette colors (red, blue, green, etc.)

Clicking a swatch sets the picker to that color immediately.


Keyboard Shortcuts

Key Action
Escape Close the picker
Enter Confirm and close
Tab Cycle between input fields

Integration with Colors Module

The Colors module's OpenPicker and CreateColorPicker methods delegate to the ColorPicker module internally. You rarely need to interact with RGXColorPicker directly — use RGXColors as the primary interface.

-- Recommended: use Colors module
RGX:GetColors():OpenPicker(r, g, b, callback)

-- Direct access (also works)
RGX:GetColorPicker():Show(r, g, b, a, callback)

Clone this wiki locally