Skip to content

ColorPalette

github-actions[bot] edited this page Jun 13, 2026 · 2 revisions

Contents

ColorPalette manages multiple keyed color values in one row. Use it for role colors, class colors, border colors, status colors, or other small named color sets owned by the host addon.

Use type = "colorpalette" for new code.

ColorPalette example

Field Type Description
entries table List of { key, label } color entries.
getColor function Reads current color by key.
setColor function Writes color by key.
hasOpacity boolean Show alpha channel.
colorizeLabel boolean Tint entry labels with current colors.

getDefaultColor is currently metadata/pass-through only and is not consumed by the UI renderer.

app:RegisterControl("bars.colors", {
  id = "classColors",
  type = "colorpalette",
  label = "Class colors",
  entries = {
    { key = "WARRIOR", label = "Warrior" },
    { key = "MAGE", label = "Mage" },
  },
  getColor = function(key)
    return MyAddonDB.profile.classColors[key]
  end,
  setColor = function(key, r, g, b, a)
    MyAddonDB.profile.classColors[key] = { r = r, g = g, b = b, a = a or 1 }
    MyAddon.RefreshClassColors()
  end,
})

type = "coloroverrides" and type = "coloroverride" are legacy aliases for type = "colorpalette". They still render the same widget for older host addons, but new code and documentation should use colorpalette.

Wiki
  • Home
  • Architecture
  • Vendoring
  • Quick Start
  • Field Glossary
  • Troubleshooting
  • Validation

Reference
  ⚬ Config API
  ⚬ UI API
  ⚬ Elements
  ⚬ Examples

Elements
  Structure
   • Category
   • Page
   • Group
   • Dashboard
   • InfoPage
   • Custom
  Controls
   • Toggle
   • CheckboxDropdown
   • Dropdown
   • MultiDropdown
   • SoundDropdown
   • Input
   • Slider
   • Button
  Advanced
   • ColorPicker
   • ColorPalette
   • ColorOverrides
   • ReorderList
   • Expandable
   • Notes

Examples
  Start
   • Minimal Addon
   • Complete Settings Center
   • Wrapper Bridge Pattern
  Data and Behavior
   • Dependent Controls
   • Nested Database Values
   • Dynamic Dropdowns
   • Runtime Refresh
   • Search and New Badges
   • Custom Hosted Editors
  Polish
   • Support Links
   • Theme Colors
   • Theme Borders

Clone this wiki locally