CreateColor()

From Warcraft Wiki
Jump to navigation Jump to search
These functions are implemented in FrameXML/Util.lua.

Creates a ColorMixin.

color = CreateColor(r, g, b [, a])
color = CreateColorFromBytes(r, g, b, a)
color = CreateColorFromHexString(hexColor)

Arguments

CreateColor()
r, g, b
number - Values between 0 and 1.
a
number?Optional. Could be nil. - Value between 0 and 1, or nil to leave undefined (some methods will default to 100%).
CreateColorFromBytes()
r, g, b, a
number - Values between 0 and 255 (cannot omit alpha).
CreateColorFromHexString()
hexColor
string - Eight hexadecimal digits as AARRGGBB.

Returns

color
table - ColorMixin

Patch changes

  • Battle for Azeroth Patch 8.1.0 (2018-12-11): CreateColorFromBytes() and CreateColorFromHexString() added.[1]
  • Legion Patch 7.0.3 (2016-07-19): CreateColor() added.[2]

External links

CreateColor()
CreateColorFromBytes()
CreateColorFromHexString()

References

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