Skip to content

Instantly share code, notes, and snippets.

View darltrash's full-sized avatar
🏠
home.

Neil Wolfkid darltrash

🏠
home.
View GitHub Profile
function Util: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
@darltrash
darltrash / gist:b10d2aaaba402eeb20679bec835683a1
Last active April 2, 2021 22:49 — forked from hashmal/gist:874792
[Lua] Print table contents recursively
-- Print contents of `tbl`, with indentation.
-- `indent` sets the initial level of indentation.
function tprint (tbl, indent)
local indent = indent or 0
for k, v in pairs(tbl) do
formatting = string.rep(" ", indent) .. k .. ": "
if type(v) == "table" then
print(formatting)
tprint(v, indent+1)
else