vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 -- Math functions
2 --
3  
4 function Gatherer_round(x, n)
5 n = math.pow(10, n or 0)
6 x = x * n
7 if x >= 0 then x = math.floor(x + 0.5) else x = math.ceil(x - 0.5) end
8 return x / n
9 end
10  
11  
12 function Gatherer_rgbToFloatColor(color)
13 local MAX_RGB = 255;
14 local floatColor = {}
15 for _, component in color do
16 tinsert(floatColor, component/MAX_RGB)
17 end
18 return floatColor
19 end