basic serialization worx*
*
This commit is contained in:
parent
d76ace8f69
commit
973a8ab25b
41 changed files with 162 additions and 82 deletions
|
|
@ -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)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue