WoW API: GetThreatStatusColor

From AddOn Studio
Revision as of 21:40, 12 October 2008 by WoWWiki>Scudmarx (New page: {{wowapi}} __NOTOC__ <!-- Describe the purpose of the function, exhausting detail can be saved for a later section --> Returns RGB color values relating to a threat status. New in [Patc...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

WoW API < GetThreatStatusColor


Returns RGB color values relating to a threat status. New in Patch 3.0.

r, g, b = GetThreatStatusColor(status)


Parameters

Arguments

status
Integer - the threat status value to get colors for.

Returns

r
Number - Returns a value between 0 and 1 for the red content of the color.
g
Number - Returns a value between 0 and 1 for the green content of the color.
b
Number - Returns a value between 0 and 1 for the blue content of the color.

Example

local status, statustxts = UnitThreatSituation("player", "target"), {"low on threat",  "overnuking", "losing threat", "tanking securely"};
local r, g, b = GetThreatStatusColor(status);
ChatFrame1:AddMessage('You are ' .. statustxts[status+1] .. '.', r, g, b);

Result

Prints a description of the player's threat situation to the chat frame, colored appropriately. e.g.
You are overnuking.

See also

API UnitThreatSituation | API UnitDetailedThreatSituation