Returns a color indicating hostility and related status of a unit. This color is used in various places in the default UI, such as the background behind a unit's name in the target and focus frames. For NPCs, the color reflects hostility and reputation, ranging from red (hostile) to orange or yellow (unfriendly or neutral) to green (friendly). When the unit is a player, a blue color is used unless the player is active for PvP, in which case the color may be red (he can attack you and you can attack him), yellow (you can attack him but he can't attack you) or green (ally). Color component values are floating point numbers between 0 and 1.
See also Unit functions.
unit- A unit to query (
name- The name of a unit to query; only valid for
pet, and party/raid members (
red- The red component of the color. (
green- The green component of the color. (
blue- The blue component of the color. (
alpha- The alpha (opacity) component of the color. (