module refactoring
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
module 'aux'
|
||||
|
||||
local T = require 'T'
|
||||
|
||||
function C(r, g, b, a)
|
||||
local mt = O('__metatable', false, '__newindex', nop, 'color', A(r, g, b, a))
|
||||
local mt = T.map('__metatable', false, '__newindex', nop, 'color', T.list(r, g, b, a))
|
||||
function mt:__call(text)
|
||||
local r, g, b, a = unpack(mt.color)
|
||||
if text then
|
||||
@@ -14,7 +16,7 @@ function C(r, g, b, a)
|
||||
local r, g, b, a = unpack(mt.color)
|
||||
return format('|c%02X%02X%02X%02X', a, r, g, b) .. text
|
||||
end
|
||||
return setmetatable(T, mt)
|
||||
return setmetatable(T.acquire(), mt)
|
||||
end
|
||||
|
||||
M.color = immutable-{
|
||||
|
||||
Reference in New Issue
Block a user