View Single Post
01/31/19, 06:12 AM   #4
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,579
In addition you can use ZO_ColorDef in order to simplify the handling of everything related to colors. Your example would then look like this:
Lua Code:
  1. local myIcon = zo_iconFormatInheritColor(texturePath, textureSize, textureSize)
  2. local MY_COLOR = ZO_ColorDef:New("FF0000")
  3. label:SetText(MY_COLOR:Colorize(myIcon))
There are also a lot of predefined colors used by the game. You can find them in defaultcolordefs.lua.

p.s. in Lua you'd typically use lower_case or camelCase names for regular variables and ALL_CAPS for constants. Only classes or (at least in ESO) functions should use an uppercase letter.
  Reply With Quote