mirror of
https://github.com/appgurueu/modlib.git
synced 2024-11-22 23:33:53 +01:00
colorspec: expose metatable
This commit is contained in:
parent
f06bda9785
commit
2d47f5fd9f
@ -159,7 +159,8 @@ named_colors = {
|
|||||||
|
|
||||||
colorspec = {}
|
colorspec = {}
|
||||||
|
|
||||||
local colorspec_metatable = {__index = colorspec}
|
local metatable = {__index = colorspec}
|
||||||
|
colorspec.metatable = metatable
|
||||||
|
|
||||||
function colorspec.new(table)
|
function colorspec.new(table)
|
||||||
return setmetatable({
|
return setmetatable({
|
||||||
@ -167,7 +168,7 @@ function colorspec.new(table)
|
|||||||
g = assert(table.g),
|
g = assert(table.g),
|
||||||
b = assert(table.b),
|
b = assert(table.b),
|
||||||
a = table.a or 255
|
a = table.a or 255
|
||||||
}, colorspec_metatable)
|
}, metatable)
|
||||||
end
|
end
|
||||||
|
|
||||||
colorspec.from_table = colorspec.new
|
colorspec.from_table = colorspec.new
|
||||||
|
Loading…
Reference in New Issue
Block a user