colorspec: expose metatable

This commit is contained in:
Lars Mueller 2021-11-13 23:35:02 +01:00
parent f06bda9785
commit 2d47f5fd9f

@ -159,7 +159,8 @@ named_colors = {
colorspec = {}
local colorspec_metatable = {__index = colorspec}
local metatable = {__index = colorspec}
colorspec.metatable = metatable
function colorspec.new(table)
return setmetatable({
@ -167,7 +168,7 @@ function colorspec.new(table)
g = assert(table.g),
b = assert(table.b),
a = table.a or 255
}, colorspec_metatable)
}, metatable)
end
colorspec.from_table = colorspec.new