Skip to content

Output nice colors to the terminal using lua. This module also overrides the print() function to something more useful.

License

Notifications You must be signed in to change notification settings

josellausas/luaColors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

luaColors

Outputs nice colors to the terminal when using lua's print() function. This module also gives you extra information that is handy for tracing your messages through the code.

Use inside the print() function to turn off/on text formatting and colors.

##Available colors and formats:

###Text and background colors:

  • Black
  • Red
  • Green
  • Yellow
  • Blue
  • Magenta
  • Cyan
  • White

###Other options:

  • Bold
  • Underline
  • Blink
  • Inverse
  • Strikeout

Example:

-- Use lc to toggle different text formats and colors. Reset them with lc.off
local lc = require(“luaColors”)
print(lc.off .. lc.blue .. lc.bg.white ..Hello Color World.. lc.off);
-- Turns off previous format. 
-- Turns on blue color. 
-- Turns on white background.

About

Output nice colors to the terminal using lua. This module also overrides the print() function to something more useful.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages