API UnitSelectionColor

From Wowpedia
Jump to: navigation, search

Returns RGBA values for the color of the unit's selection (the outline around and the circle underneath a player character or an NPC).

red, green ,blue, alpha = UnitSelectionColor(UnitId[, useExtendedColors])

Arguments

UnitId 
String - The unit whose selection colour should be returned.
useExtendedColors 
Boolean (optional) - If true, a more appropriate colour of the unit's selection will be returned. For instance, if used on a dead hostile target, the default return will red (hostile), but the extended return will be grey (dead).

Returns

red 
Number - A number between 0 and 1.
green 
Number - A number between 0 and 1.
blue 
Number - A number between 0 and 1.
alpha 
Number - A number between 0 and 1.

Examples

0, 0, 0.99999779462814, 0.99999779462814 = UnitSelectionColor("player")
0, 0.99999779462814, 0, 0.99999779462814 = UnitSelectionColor("target") -- a friendly npc in target

See Also