Advertisement
CapsAdmin

Untitled

Mar 3rd, 2013
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.31 KB | None | 0 0
  1. local cache = {}
  2. local precision = 1
  3.  
  4. function HSVToColorFast(h,s,v)
  5.     h = math.Round(h, precision)
  6.     s = math.Round(s, precision)
  7.     v = math.Round(v, precision)
  8.    
  9.     cache[h] = cache[h] or {}
  10.     cache[h][s] = cache[h][s] or {}
  11.     cache[h][s][v] = cache[h][s][v] or HSVToColor(h,s,v)
  12.    
  13.     return cache[h][s][v]
  14. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement