Fandom

World of Warcraft Wiki

API GetThreatStatusColor

10 756pages on
this wiki
Add New Page
Comments0 Share

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

Returns RGB color values corresponding to a threat status returned by UnitThreatSituation. Added in Patch 3.0.

r, g, b = GetThreatStatusColor(statusIndex)

ArgumentsEdit

status 
integer - the threat status value to get colors for

ReturnsEdit

number - a value between 0 and 1 for the red content of the color
number - a value between 0 and 1 for the green content of the color
number - a value between 0 and 1 for the blue content of the color

ExampleEdit

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)

ResultEdit

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.

NotesEdit

As of Patch 3.0.9, the following r, g, b values are returned for each threat level:

0: 0.69, 0.69, 0.69
1: 1, 1, 0.47
2: 1, 0.6, 0
3: 1, 0, 0

See alsoEdit

Also on Fandom

Random Wiki