manaphoenix

Ficsit Networks [Color Module]

Sep 27th, 2020 (edited)
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.06 KB | None | 0 0
  1. local color = {}
  2.  
  3. color.silver = {0.75294117647059, 0.75294117647059, 0.75294117647059}
  4. color.cyan = {0, 1, 1}
  5. color.lightblue = {0.67843137254902, 0.84705882352941, 0.90196078431373}
  6. color.brown = {0.58823529411765, 0.29411764705882, 0}
  7. color.orange = {1, 0.64705882352941, 0}
  8. color.red = {1, 0, 0}
  9. color.magenta = {1, 0, 1}
  10. color.blue = {0, 0, 1}
  11. color.pink = {1, 0.75294117647059, 0.79607843137255}
  12. color.white = {1, 1, 1}
  13. color.black = {0, 0, 0}
  14. color.green = {0, 1, 0}
  15. color.lime = {0.74901960784314, 1, 0}
  16. color.yellow = {1, 1, 0}
  17. color.purple = {0.50196078431373, 0, 0.50196078431373}
  18. color.gray = {0.50196078431373, 0.50196078431373, 0.50196078431373}
  19.  
  20. color.fromRGB = function(r,g,b)
  21.     return {r/255, g/255, b/255}
  22. end
  23.  
  24. color.fromHEX = function(hex)
  25.     hex = hex:gsub("#","")
  26.     if (hex:len() == 3) then
  27.         return {tonumber(hex:sub(1,1),16)*17/255, tonumber(hex:sub(2,2),16)*17/255, tonumber(hex:sub(3,3),16)*17/255}
  28.     else
  29.         return {tonumber(hex:sub(1,2),16)/255, tonumber(hex:sub(3,4),16)/255, tonumber(hex:sub(5,6),16)/255}
  30.     end
  31. end
  32.  
  33. return color
  34.  
Add Comment
Please, Sign In to add comment