m
Move page script moved page API GetItemQualityColor to WoW:API GetItemQualityColor without leaving a redirect
(There is no '#' in GetItemQualityColor() output) |
m (Move page script moved page API GetItemQualityColor to WoW:API GetItemQualityColor without leaving a redirect) |
||
| (6 intermediate revisions by 5 users not shown) | |||
| Line 4: | Line 4: | ||
r, g, b, hex = GetItemQualityColor(quality) | r, g, b, hex = GetItemQualityColor(quality) | ||
== Arguments == | |||
* quality (number) - The numeric ID of the quality from 0 (Poor) to 7 (Heirloom). | |||
== Returns == | |||
* r (number) - The Red component of the color (0 to 1, inclusive). | |||
* g (number) - The Green component of the color (0 to 1, inclusive). | |||
* b (number) - The Blue component of the color (0 to 1, inclusive). | |||
* hex (string) - The 4 character hex [[UI escape sequences|UI escape sequence]] for this color | |||
== Example == | == Example == | ||
for i = 0, | for i = 0, 8 do | ||
local r, g, b, hex = GetItemQualityColor(i) | local r, g, b, hex = GetItemQualityColor(i) | ||
print(i, hex, | print(i, hex, _G["ITEM_QUALITY" .. i .. "_DESC"], hex:sub(5)) | ||
end | end | ||
=== Result === | === Result === | ||
: Will print all qualities, in their individual colors (example result from version | : Will print all qualities, in their individual colors (example result from version 6.2.4). | ||
0 <span style="color: #9d9d9d">Poor ff9d9d9d</span> | |||
0 <span style="color: #9d9d9d">Poor | 1 <span style="color: #ffffff">Common ffffffff</span> | ||
1 <span style="color: #ffffff">Common | 2 <span style="color: #1eff00">Uncommon ff1eff00</span> | ||
2 <span style="color: #1eff00">Uncommon | 3 <span style="color: #0070dd">Rare ff0070dd</span> | ||
3 <span style="color: #0070dd">Rare | 4 <span style="color: #a335ee">Epic ffa335ee</span> | ||
4 <span style="color: #a335ee">Epic | 5 <span style="color: #ff8000">Legendary ffff8000</span> | ||
5 <span style="color: #ff8000">Legendary | 6 <span style="color: #e6cc80">Artifact ffe6cc80</span> | ||
6 <span style="color: #e6cc80">Artifact | 7 <span style="color: #e6cc80">Heirloom ffe6cc80</span> | ||
7 <span style="color: #e6cc80">Heirloom | 8 <span style="color: #00ccff">WoW Token ff00ccff</span> | ||
==Details== | == Details == | ||
: GetItemQualityColor() was added in 1.9.1 | : GetItemQualityColor() was added in 1.9.1 | ||
| Line 46: | Line 40: | ||
::hex = |cffffffff | ::hex = |cffffffff | ||
== Changes == | |||
* Quality 7 was added in version [[Patch 3.0]] for heirloom items | |||
* ITEM_QUALITY7_DESC is now defined as of [[Patch 3.1.1]] | |||
* [[Patch 6.1.2]] introduced quality 8, WoW Token. | |||
* [[Patch 7.0.3]] changed the Heirloom color from <span style="color: #e6cc80">Heirloom ffe6cc80</span> to <span style="color: #00ccff">Heirloom ff00ccff</span>. This was likely done to avoid confusion with <span style="color: #e6cc80">Artifact ffe6cc80.</span> | |||
== See also == | == See also == | ||
* [[API ITEM_QUALITY_COLORS]] | * [[API ITEM_QUALITY_COLORS]] | ||
* [[API TYPE Quality]] | * [[API TYPE Quality|API TYPE Qualit]]y | ||