mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-06 05:30:00 +00:00
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:
@@ -133,7 +133,7 @@ pfUI:RegisterModule("chatcopy", 20400, function ()
|
||||
local AddMessage = frame.AddMessage
|
||||
frame.AddMessage = function(self,msg,r,g,b)
|
||||
if msg and r and g and b then
|
||||
local col = string.format("|cff%02x%02x%02x", r*255, g*255, b*255)
|
||||
local col = rgbhex(r,g,b)
|
||||
table.insert(history, 1, col..string.gsub(msg, "|r", col))
|
||||
elseif msg then
|
||||
table.insert(history, 1, "|cffffffff"..msg)
|
||||
|
||||
Reference in New Issue
Block a user