fab
fab copied to clipboard
:star2: print fabulously in your terminal
Print fabulously in your terminal (in Nim).
Fab is a really cool text formatting package for Nim. Using Fab is super easy, it's as simple as:
import fab
blue("hey i'm blue!")
bold("this is bold text")
que("what?")
Installation
$ nimble install fab
Screenshot
Colors
Styles
Labels
Color procs
blue(), yellow(), red(), green(), white(), purple(), black(), cyan()
Style procs
bold(), italics(), strike(), under()
Label procs
que(), info(), run(), bad(), good()
Style
styleBright, # bright text
styleDim, # dim text
styleUnknown, # unknown
styleUnderscore, # underscored text
styleBlink, # blinking/bold text
styleHidden # hidden text
Example
blue("this is bold and blue", sty = {styleBright})
ForegroundColor
fgBlack, # black
fgRed, # red
fgGreen, # green
fgYellow, # yellow
fgBlue, # blue
fgMagenta, # magenta
fgCyan, # cyan
fgWhite # white
Example
bold("this is bold and red", fg = fgRed)
More examples
blue("this is bold and underlined blue", sty = {styleBright, styleUnderscore}, nl = false) # no newline
dim("this is yellow and dim", fg = fgYellow)
Inspiration
This project was heavily inspired by @s0md3v's Hue.
Contributing
Bad code? New feature in mind? Open an issue. Better still, learn Nim and shoot a PR :sparkles:
Credits
Thanks a bunch to @kaushalmodi for the complete rewrite. It's all pretty much his now.
License
MIT © Anirudh Oppiliappan