Initial commit

This commit is contained in:
2021-04-21 01:53:13 -03:00
commit 76d1a949e2
8 changed files with 370 additions and 0 deletions

23
lua/tokyo/utils.lua Normal file
View File

@@ -0,0 +1,23 @@
local U = {}
function U.tprint(tbl, indent)
if not indent then indent = 0 end
for k, v in pairs(tbl) do
local formatting = string.rep(" ", indent) .. k .. ": "
if type(v) == "table" then
print(formatting)
U.tprint(v, indent + 1)
elseif type(v) == 'boolean' then
print(formatting .. tostring(v))
else
print(formatting .. v)
end
end
end
function U.hex2rgb(hex)
hex = hex:gsub("#","")
return tonumber("0x"..hex:sub(1,2)), tonumber("0x"..hex:sub(3,4)), tonumber("0x"..hex:sub(5,6))
end
return U