lua: print in colour
To print in colour in lua, use the escape ANSI codes as you would do in bash: \27[xxm
.
Codes:
- Red: 31
- Green: 32
- Yellow: 33
- Blue: 34
There are many more possible codes.
Example, print “hello” in red:
$ lua -e 'print("\27[31mhello\27[0m")'