Linked to related articles
(Linked to related articles) |
|||
| Line 1: | Line 1: | ||
{{wowapi}}__NOTOC__ | {{wowapi}}__NOTOC__ | ||
Returns RGB color codes for an item quality. | Returns RGB color codes for an item [[quality]]. | ||
r, g, b, hex = GetItemQualityColor(quality) | r, g, b, hex = GetItemQualityColor(quality) | ||
| Line 19: | Line 19: | ||
== Example == | == Example == | ||
for i = 0, | for i = 0, 7 do | ||
local r, g, b, hex = GetItemQualityColor(i); | local r, g, b, hex = GetItemQualityColor(i); | ||
print(getglobal("ITEM_QUALITY" .. i .. "_DESC"), | print(i, hex, getglobal("ITEM_QUALITY" .. i .. "_DESC"), string.sub(hex,5)); | ||
end | end | ||
=== Result === | |||
: Will print all qualities, in their individual colors. | : Will print all qualities, in their individual colors (example result from version 3.0.3). | ||
{{Example/Begin}} | |||
0 <span style="color: #9d9d9d">Poor #9d9d9d</span><br /> | |||
1 <span style="color: #ffffff">Common #ffffff</span><br /> | |||
2 <span style="color: #1eff00">Uncommon #1eff00</span><br /> | |||
3 <span style="color: #0070dd">Rare #0070dd</span><br /> | |||
4 <span style="color: #a335ee">Epic #a335ee</span><br /> | |||
5 <span style="color: #ff8000">Legendary #ff8000</span><br /> | |||
6 <span style="color: #e6cc80">Artifact #e6cc80</span><br /> | |||
7 <span style="color: #e6cc80">nil #e6cc80</span> | |||
{{Example/End}} | |||
==Details== | ==Details== | ||
| Line 31: | Line 41: | ||
:If an invalid quality index is specified, GetItemQualityColor() returns white (same as index 1): | :If an invalid quality index is specified, GetItemQualityColor() returns white (same as index 1): | ||
:r = 1 | ::r = 1 | ||
:g = 1 | ::g = 1 | ||
:b = 1 | ::b = 1 | ||
:hex = |cffffffff | ::hex = |cffffffff | ||
:Quality #7 was added in version 3.0 for heirloom items, although ITEM_QUALITY7_DESC has not yet been defined. | |||
== See also == | |||
* [[API ITEM_QUALITY_COLORS]] | |||
* [[API TYPE Quality]] | |||