colors.lua
local t = require("terminal")
local function main()
t.clear.screen()
t.cursor.position.stack.push(1,1)
t.text.stack.push{
fg = "white",
brightness = "dim",
}
t.output.print("Hello dim white World!")
t.text.stack.push{
fg = "white",
bg = "blue",
brightness = "normal",
}
t.output.print("Hello white on blue World!")
t.text.stack.push{
fg = "red",
bg = "black",
brightness = "bright",
}
t.output.print("Hello bright red World!")
t.text.stack.pop()
t.output.print("Hello white on blue World! (again)")
t.text.stack.pop()
t.output.print("Hello dim white World! (again)")
t.text.stack.pop()
t.output.write("Press any key, or wait 5 seconds...")
t.output.flush()
t.input.readansi(5)
end
t.initwrap(main, {
displaybackup = true,
filehandle = io.stdout,
})()
print("done!")