Coder Social home page Coder Social logo

hue's Introduction

Hue

Hue provides a minimal yet powerful way to print colored text and lables in terminal.
It doesn't have any dependencies and works with python2 as well as python3.

Supported Stuff

Following styles are supported

Following colors are supported

Following lables are supported

Usages

First of all, import everything that Hue has to offer as follows:

from hue import *

Now printing colored text is as simple as doing

print red('This string is red')

Easy right? But what if you want to print italic text? You can just do

print italic('This string is in italic')

You can also combine styles and colors

print bold(red('This string is bold and red'))

Output:

And what is the use of those lables? I have been using these lables in projects to provide a minimal and informative output schema.
If some error occured in your program or something else bad happened you don't need to print the whole line in red. That doesn't look good. With hue, you can simply do this

print bad('An error occured.')

Take a look at the output of all the lables

List of all colors

white, grey, black, green, lightgreen, cyan, lightcyan, red, lightred,
blue, lightblue, purple, light purple, orange, yellow

List of all styles

bold, bg, under, strike, italic

List of all lables

info, que, run, bad, good

Note: Windows does not support ANSI escape sequences so the colors will not be print in command prompt.

License & Contribution

The only thing I think Hue needs is windows support which I can't add atm because I have no windows machine and made since people were asking for it so its a quick one. So if you can start a pull request for windows support that would be great. Additional colors and lables will be appreciated too. Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.

hue's People

Contributors

s0md3v avatar

Watchers

Ravi Singh avatar

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.