Skip to content

Lightweight library to colorize echo on Windows PowerShell or CMD

License

Notifications You must be signed in to change notification settings

vxcall/colorizeEcho

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

💭 colorizeEcho

colorizeEcho is a super fast, and lightweight library that simply colorize echo message on Windows command prompt.

Also note that this is a Nim integration for mitchellh/colorstring.

It makes your debug message more clear and beautiful. Moreover, it gives your debugging life more comfortable and full of happiness. 😘

Installation

Run following command on your command prompt and you're good to go

$ nimble install colorizeEcho

🔥 Usage

Let me show you the minimal form of usage first:

import colorizeEcho

initColorizeEcho() # Invoking this before you call cecho is compulsory.
cecho "[magenta] supposed to be magenta color" # Use cecho just as you use echo with a magical phrase [COLOR_NAME].

To change foreground color or background color of output message, put color name surrounded by square bracket at right before the text you'd like to change color.

e.g. for foreground = [red], [cyan]

e.g. for background = [bRed], [bCyan]

To change font weight, put [bold] or [regular] at right before the text

import colorizeEcho

initColorizeEcho()

cecho "[magenta]Every [green]color [cyan]is [default]beautiful."

cecho "[black][bgMagenta]Background [bgGreen]color [bgLightRed]is [bgCyan]changable [bgYellow]too."

cecho "[lightYellow][bold]THICC TEXT [regular]REGULAR TEXT"

result ↓

result

🎈 Available colors

foreground background weight
[default] [bgDefault] [regular]
[black] [bgBlack] [bold]
[red] [bgRed]
[green] [bgGreen]
[yellow] [bgYellow]
[blue] [bgBlue]
[magenta] [bgMagenta]
[cyan] [bgCyan]
[white] [bgWhite]
[darkGray] [bgDarkGray]
[lightRed] [bgLightRed]
[lightGreen] [bgLightGreen]
[lightYellow] [bgLightYellow]
[lightBlue] [bgLightBlue]
[lightMagenta] [bgLightMagenta]
[lightCyan] [bgLightCyan]
[lightWhite] [bgLightWhite]

About

Lightweight library to colorize echo on Windows PowerShell or CMD

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Languages