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-05-01 15:23:05 +02:00
committed by shagu
parent 0ea4d54f24
commit cf4c9ac361
8 changed files with 58 additions and 28 deletions
+1 -1
View File
@@ -315,7 +315,7 @@ pfUI:RegisterModule("buffwatch", function ()
sr, sg, sb, sa = 1, .3, .3, 1
end
if frame.config.colorstacks == "1" then
frame.bars[bar].stacks:SetText("|cff" .. string.format("%02x%02x%02x", sr*255, sg*255, sb*255) .. data[5])
frame.bars[bar].stacks:SetText(rgbhex(sr,sg,sb) .. data[5])
else
frame.bars[bar].stacks:SetText(data[5])
end