GithubHelp home page GithubHelp logo

pseuxide / colorizeecho Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 22 KB

Lightweight library to colorize echo on Windows PowerShell or CMD

License: MIT License

Nim 100.00%
nim colorstring message color

colorizeecho's Introduction

πŸ’­ 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]

colorizeecho's People

Contributors

pseuxide avatar

Stargazers

 avatar

Watchers

 avatar

colorizeecho's Issues

Create tags

Hello.
Can you create tags for all your version please ? My project isn’t compatible with the last version (master) and I can’t choose a version in my nimble project file without git tags.
Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.