Scudmarx50532@legacy41569935 (talk | contribs) mNo edit summary |
Scudmarx50532@legacy41569935 (talk | contribs) m (→Example) |
||
Line 24: | Line 24: | ||
<!-- If it helps, include an example here, though it's not required if the usage is self-explanatory --> |
<!-- If it helps, include an example here, though it's not required if the usage is self-explanatory --> |
||
<!-- begin code --> |
<!-- begin code --> |
||
− | local status = UnitThreatSituation("player", "target"), {"low on threat", "overnuking", "losing threat", "tanking securely"}; |
+ | local status, statustxts = UnitThreatSituation("player", "target"), {"low on threat", "overnuking", "losing threat", "tanking securely"}; |
local r, g, b = GetThreatStatusColor(status); |
local r, g, b = GetThreatStatusColor(status); |
||
ChatFrame1:AddMessage('You are ' .. statustxts[status+1] .. '.', r, g, b); |
ChatFrame1:AddMessage('You are ' .. statustxts[status+1] .. '.', r, g, b); |
||
Line 35: | Line 35: | ||
<font color="yellow">You are overnuking.</font> |
<font color="yellow">You are overnuking.</font> |
||
<!-- end code --> |
<!-- end code --> |
||
− | |||
== See also == |
== See also == |
Revision as of 22:19, 12 October 2008
Automated updating of API pages at this location, to reflect patch changes, has ceased from 10.1.7 onwards. |
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.