For those who like to use hex colors and are off put by the RGB we have now here you go
Code:
local function GetRGB(hex)
local tbl = {}
tbl.r = tonumber("0x" .. string.sub(hex, 1, 2)) / 255
tbl.g = tonumber("0x" .. string.sub(hex, 3, 4)) / 255
tbl.b = tonumber("0x" .. string.sub(hex, 5, 6)) / 255
return tbl
end
Pretty simple. Returns a table with r, g, b values that you can use to easily set a color for your element.
Example Use:
Code:
local context = UI.CreateContext("SampleContext")
local frame = UI.CreateFrame("Frame", "SampleFrame", context)
local rgb = GetRGB("FF00DD")
frame:SetBackgroundColor(rgb.r, rgb.g, rgb.b, 1)
Can probably implement this in a way that lets users enter a hex number into the console for a color
.