Advertisement
incinirate

HexColors API

Jul 29th, 2014
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.60 KB | None | 0 0
  1. -- white, orange, magenta, lightBlue, yellow, lime, pink, gray, lightGray, cyan, purple, blue, brown, green, red, black
  2. local defHex = { 0xFFFFFF, 0xFFA500, 0xFF00FF, 0xADD8E6, 0xFFFF00, 0x00FF00, 0xFFC0CB, 0x808080, 0xD3D3D3, 0x00FFFF, 0x800080, 0x0000FF, 0xA52A2A, 0x008000, 0xFF0000, 0x000000 }
  3. local color
  4. _G.hexColors = {}
  5. for i = 1, #defHex do
  6.     color = 2^(i-1) --this line is mine, cause the other one didnt look as nice
  7.     table.insert(hexColors, color, defHex[i])
  8. end
  9. --this part is mine
  10. for k,v in pairs(colors) do
  11.     hexColors[k] = hexColors[v]
  12.     hexColors[v] = nil
  13. end
  14. --end my part
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement