Skip to content

Commit

Permalink
Support importing a color table
Browse files Browse the repository at this point in the history
  • Loading branch information
p3lim committed Nov 1, 2024
1 parent 3639e98 commit 2166a08
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/misc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,9 @@ Alpha (`a`) will always be in the 0-1 range.
Wrapper for CreateColor that can handle hex colors (both `RRGGBB` and `AARRGGBB`).
--]]
function addon:CreateColor(r, g, b, a)
if type(r) == 'string' then
if type(r) == 'table' then
return addon:CreateColor(r.r, r.g, r.b, r.a)
elseif type(r) == 'string' then
-- load from hex
local hex = r:gsub('#', '')
if #hex == 8 then
Expand Down

0 comments on commit 2166a08

Please sign in to comment.