mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-09 15:10: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:
+1
-1
@@ -53,7 +53,7 @@ local getFontString = function(obj)
|
||||
segment = segment and segment ~= "" and segment or nil
|
||||
if segment then
|
||||
r, g, b, a = left:GetTextColor()
|
||||
segment = "|c" .. string.format("ff%02x%02x%02x", r*255, g*255, b*255) .. segment .. "|r"
|
||||
segment = rgbhex(r,g,b) .. segment .. "|r"
|
||||
text = text and text .. "\n" .. segment or segment
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user