module refactoring

This commit is contained in:
Manuel Simon Hirsig
2017-11-25 17:53:39 +01:00
parent 6f71167e48
commit ab94acc2be
38 changed files with 402 additions and 453 deletions
+2 -2
View File
@@ -3,7 +3,7 @@ module 'aux'
local T = require 'T'
function C(r, g, b, a)
local mt = T.map('__metatable', false, '__newindex', nop, 'color', T.list(r, g, b, a))
local mt = T.map('__metatable', false, '__newindex', pass, 'color', T.list(r, g, b, a))
function mt:__call(text)
local r, g, b, a = unpack(mt.color)
if text then
@@ -20,7 +20,7 @@ function C(r, g, b, a)
end
M.color = immutable-{
none = setmetatable({}, {__metatable=false, __newindex=nop, __call=function(_, v) return v end, __concat=function(_, v) return v end}),
none = setmetatable({}, {__metatable=false, __newindex=pass, __call=function(_, v) return v end, __concat=function(_, v) return v end}),
text = immutable-{enabled = C(255, 254, 250, 1), disabled = C(147, 151, 139, 1)},
label = immutable-{enabled = C(216, 225, 211, 1), disabled = C(150, 148, 140, 1)},
link = C(153, 255, 255, 1),