2 local tostring = tostring
3 local setmetatable
= setmetatable
4 local schar
= string.char
8 function colormt
:__tostring()
12 function colormt
:__concat(other
)
13 return tostring(self
) .. tostring(other
)
16 function colormt
:__call(s
)
17 return self
.. s
.. _M
.reset
20 colormt
.__metatable
= {}
22 local function makecolor(value
)
23 return setmetatable({ value
= schar(27) .. '[' .. tostring(value
) .. 'm' }, colormt
)
59 for c
, v
in pairs(colors
) do
60 Ansicolors
[c
] = makecolor(v
)