Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local color = {}
- color.silver = {0.75294117647059, 0.75294117647059, 0.75294117647059}
- color.cyan = {0, 1, 1}
- color.lightblue = {0.67843137254902, 0.84705882352941, 0.90196078431373}
- color.brown = {0.58823529411765, 0.29411764705882, 0}
- color.orange = {1, 0.64705882352941, 0}
- color.red = {1, 0, 0}
- color.magenta = {1, 0, 1}
- color.blue = {0, 0, 1}
- color.pink = {1, 0.75294117647059, 0.79607843137255}
- color.white = {1, 1, 1}
- color.black = {0, 0, 0}
- color.green = {0, 1, 0}
- color.lime = {0.74901960784314, 1, 0}
- color.yellow = {1, 1, 0}
- color.purple = {0.50196078431373, 0, 0.50196078431373}
- color.gray = {0.50196078431373, 0.50196078431373, 0.50196078431373}
- color.fromRGB = function(r,g,b)
- return {r/255, g/255, b/255}
- end
- color.fromHEX = function(hex)
- hex = hex:gsub("#","")
- if (hex:len() == 3) then
- 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}
- else
- return {tonumber(hex:sub(1,2),16)/255, tonumber(hex:sub(3,4),16)/255, tonumber(hex:sub(5,6),16)/255}
- end
- end
- return color
Add Comment
Please, Sign In to add comment