basic serialization worx*

*
This commit is contained in:
0x81c 2015-03-17 01:59:14 -04:00
parent d76ace8f69
commit 973a8ab25b
41 changed files with 162 additions and 82 deletions

View file

@ -11,6 +11,7 @@ Color.static.list = {
}
function Color:initialize(inColor)
self.name = inColor
local c = Color.list[inColor]
self.r, self.g, self.b, self.a = c.r, c.g, c.b, c.a
end
@ -19,6 +20,10 @@ function Color:set()
return self.r, self.g, self.b, self.a
end
function Color:getname()
return self.name
end
function randomColor()
local colors = {"red", "green", "blue"}
return colors[math.random(1, 3)]