Skip to content

Commit

Permalink
Add CreateColor method/wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
p3lim committed Jul 22, 2024
1 parent e0c938e commit 7a74126
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions modules/misc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,13 @@ do
return data
end
end

--[[ namespace:CreateColor(r, g, b[, a])
Wrapper for CreateColor that can handle >1-255 range as well.
--]]
function addon:CreateColor(r, g, b, a)
if r > 1 then r = r / 255 end
if g > 1 then g = g / 255 end
if b > 1 then b = b / 255 end
return CreateColor(r, g, b, a)

Check warning on line 174 in modules/misc.lua

View workflow job for this annotation

GitHub Actions / lint

accessing undefined variable 'CreateColor'
end

0 comments on commit 7a74126

Please sign in to comment.