WoW API: GetThreatStatusColor
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.