Permalink
Browse files

colors: Move division into ColorGradient.

  • Loading branch information...
1 parent 11f5e12 commit 2e3bda3a3a412caf3a85ffbf0257397a4e3a2061 @haste haste committed Oct 1, 2011
Showing with 8 additions and 1 deletion.
  1. +8 −1 colors.lua
View
@@ -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

0 comments on commit 2e3bda3

Please sign in to comment.