Skip to content

Commit

Permalink
colors: Update color fetching (#667)
Browse files Browse the repository at this point in the history
  • Loading branch information
ls- committed Jan 16, 2024
1 parent f6236c6 commit b558ba1
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions colors.lua
Expand Up @@ -144,21 +144,25 @@ local staggerIndices = {
for power, color in next, PowerBarColor do
if (type(power) == 'string') then
if(type(select(2, next(color))) == 'table') then
if(color.r) then
colors.power[power] = oUF:CreateColor(color.r, color.g, color.b)
if(color.atlas) then
colors.power[power]:SetAtlas(color.atlas)
end
else
-- special handling for stagger
colors.power[power] = {}
for name, color_ in next, color do
local index = staggerIndices[name]
if(index) then
colors.power[power][index] = oUF:CreateColor(color_.r, color_.g, color_.b)
end
end
else
colors.power[power] = oUF:CreateColor(color.r, color.g, color.b)
if(color.atlas) then
colors.power[power]:SetAtlas(color.atlas)
if(color_.atlas) then
colors.power[power][index]:SetAtlas(color_.atlas)
end
end
end
end
end
Expand Down

0 comments on commit b558ba1

Please sign in to comment.