Skip to content

Commit

Permalink
colors: Move division into ColorGradient.
Browse files Browse the repository at this point in the history
  • Loading branch information
haste committed Oct 1, 2011
1 parent 11f5e12 commit 2e3bda3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion colors.lua
Expand Up @@ -42,7 +42,14 @@ for eclass, color in next, FACTION_BAR_COLORS do
end

-- http://www.wowwiki.com/ColorGradient
local ColorGradient = function(perc, ...)
local ColorGradient = function(a, b, ...)
local perc
if(b == 0) then
perc = 0
else
perc = a / b
end

if perc >= 1 then
local r, g, b = select(select('#', ...) - 2, ...)
return r, g, b
Expand Down

0 comments on commit 2e3bda3

Please sign in to comment.