Skip to content

Class Color

Core Helper

Returns the active ColorMixin-style color table for a class token, honoring CUSTOM_CLASS_COLORS when present.

NamespaceEModuleCoreLifecyclestable
E:ClassColor(class, usePriestColor)

Returns the active ColorMixin-style color table for a class token, honoring CUSTOM_CLASS_COLORS when present.

  • class: Uppercase class token such as MAGE, WARRIOR, or PRIEST.
  • usePriestColor: Optional boolean used by ElvUI when priest color handling needs special treatment.

Color table with r, g, b, colorStr, and related ColorMixin fields, or nil when the class token cannot resolve.

local color = E:ClassColor("MAGE")
if color then
frame.Text:SetTextColor(color.r, color.g, color.b)
end

Useful for addon UI that should match ElvUI class-color overrides instead of only Blizzard defaults.

Source: ElvUI/Game/Shared/General/API.lua:255