api: add and use rgbhex function

* A memoizing method to cache and return hex colorstrings from rgb input.
* Refactor all occurences of adhoc rgb to hex string concatenation to use the new method
* Refactor chat module to use it
This commit is contained in:
Road-block
2019-04-29 19:38:55 +03:00
committed by shagu
parent 0ea4d54f24
commit cf4c9ac361
8 changed files with 58 additions and 28 deletions
+2 -2
View File
@@ -1412,7 +1412,7 @@ function pfUI.uf:RefreshUnit(unit, component)
pfUI.uf:AddIcon(unit, pos, icon)
end
-- hide unued icon slots
-- hide unused icon slots
for pos=table.getn(active)+1, 6 do
pfUI.uf:HideIcon(unit, pos)
end
@@ -2062,5 +2062,5 @@ function pfUI.uf.GetColor(self, preset)
g = ( g + .75 ) * .5
b = ( b + .75 ) * .5
return "|cff" .. string.format("%02x%02x%02x", r*255, g*255, b*255)
return rgbhex(r,g,b)
end