ColorMixin

From Wowpedia
Jump to: navigation, search

Defined in FrameXML/Util.lua, the ColorMixin interface represents a color with red, green, blue and optional alpha.

Construction

  • CreateColor(r, g, b [, a]) - Creates a new color with three or four values between 0 and 1.
  • CreateColorFromHexString(hexColor) - Creates a new color from a string of eight hexademical characters as AARRGGBB.
  • CreateColorFromBytes(r, g, b, a) - Creates a new color with four values between 0 and 255.

Methods

Fundamental
String output
Calculation
  • ColorMixin:IsEqualTo(otherColor) - Indicates if two colors have equal red, green, blue and alpha components.

Example

local color = CreateColor(1, 1, 0)
print("Did someone say " .. color:WrapTextInColorCode("yellow") .. "?")   -- Did someone say yellow?

Patch changes

See also

External Links

References

 
  1. ^ 2018-12-07, Util.lua, version 8.1.0.28724, near line 628, archived at Townlong-Yak
  2. ^ 2018-07-16, Util.lua, version 8.0.1.27101, near line 646, archived at Townlong-Yak
  3. ^ 2016-07-19, Util.lua, version 7.0.3.22267, near line 621, archived at Townlong-Yak