API GetThreatStatusColor

Returns RGB color values corresponding to a threat status returned by UnitThreatSituation. Added in Patch 3.0. r, g, b = GetThreatStatusColor(statusIndex)

Arguments

 * status : integer - the threat status value to get colors for

Returns

 * r : number - a value between 0 and 1 for the red content of the color
 * g : number - a value between 0 and 1 for the green content of the color
 * b : number - 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) print("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 low on threat. You are overnuking. You are losing threat. You are tanking securely.