Thread Tools Display Modes
Prev Previous Post   Next Post Next
01/31/19, 06:12 AM   #4
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,602
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
 

ESOUI » AddOns » AddOn Help/Support » Icon and Texture tinting in Addons


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off