Code Monkey home page Code Monkey logo

bash-tint's Introduction

bash-tint

Build Status GitHub license GitHub stars awesomeness

Bash-tint aims to make your script's output nice and colorful, as easy as possible.

# Compare regular ANSI/VT100 Control sequences
echo -e "e[97m\e[46mT\e[49m\e[45mI\e[49m\e[43mN\e[49m\e[40mT\e[49m\e[39m is fun!"
# To the simplicity of tint:
tint "white(Cyan(T)Magenta(I)Yellow(N)Black(T)) is fun!"

It is more readable than the regular ANSI/VT100 Control sequences:

# Can you guess what will this output?
^[[97m^[[41mR^[[49m^[[43mA^[[49m^[[103mI^[[49m^[[42mN^[[49m^[[104mB^[[49m^[[44mO^[[49m^[[45mW^[[49m^[[39m$

# How about this?
tint "white(Red(R)Yellow(A)Light_yellow(I)Green(N)Light_blue(B)Blue(O)Magenta(W))"

It also comes with tintf, the colorful sister of printf:

tintf "Running test: bold(%s) %s" "Test XYZ" "green([OK])"

Installation

Manually

git clone https://github.com/ArtBIT/bash-tint.git
source path/to/bash-tint/src/tint

Using bash-clam

clamx ArtBIT/bash-tint --source src/tint

Usage

Examples

tint "white(Cyan(T)Magenta(I)Yellow(N)Black(T)) is bold(really) easy to use."

tintf "Running test: bold(%s) %s" "Test XYZ" "green([OK])"

tintf "bold(%s) %s" "red([Error:])" "Could not load config file."

for (( i=0; i<=$(tput colors); i++ )); do tintf "Color($i)( )"; done;

Credits

http://wiki.bash-hackers.org/scripting/terminalcodes (Thanks to sdk- for pointing me in the right direction)

License

MIT

bash-tint's People

Contributors

artbit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

heitormsilva

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.