WoW API < GetItemQualityColor

Returns RGB color codes for an item quality.

r, g, b, hex = GetItemQualityColor(quality)

Arguments Edit

Number - The numeric ID of the quality from 0 (Poor) to 7 (Heirloom).

Returns Edit

Number - The Red component of the color (0 to 1, inclusive).
Number - The Green component of the color (0 to 1, inclusive).
Number - The Blue component of the color (0 to 1, inclusive).
String - The 4 character hex UI escape sequence for this color.

Example Edit

for i = 0, 7 do
  local r, g, b, hex = GetItemQualityColor(i);
  print(i, hex, getglobal("ITEM_QUALITY" .. i .. "_DESC"), string.sub(hex,5));

Result Edit

Will print all qualities, in their individual colors (example result from version 3.1.1).

Template:Example/Begin 0 Poor ff9d9d9d
Common ffffffff
Uncommon ff1eff00
Rare ff0070dd
Epic ffa335ee
Legendary ffff8000
Artifact ffe6cc80
Heirloom ffe6cc80 Template:Example/End


GetItemQualityColor() was added in 1.9.1
If an invalid quality index is specified, GetItemQualityColor() returns white (same as index 1):
r = 1
g = 1
b = 1
hex = |cffffffff
Quality #7 was added in version 3.0 for heirloom items.
ITEM_QUALITY7_DESC is now defined as of 3.1.1.

See also Edit

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.