pip install tinge
Or upgrade current version:
pip install --upgrade tinge
- Clone this repository
git clone https://github.com/g-paras/tinge.git
cd tinge
- Install the module
python setup.py install
Installation Complete 🎉
from tinge import colored
print(colored("This is red text", color="red"))
Or
from tinge import cprint
cprint("Hello there", color="green")
from tinge import colored
print(colored("Green on white", color="green", on_color="white"))
Or
from tinge import cprint
cprint("Red on black", color="red", on_color="black")
underline & italic are not supported on windows
from tinge import italic, underline, bold
print(italic("This is italic"))
print(underline("This is underlined"))
print(bold("This is bold"))
from tinge import colored, italic, underline, bold
print(
underline("This is red on white",
color="red",
on_color="white")
)
print(
italic("This is italic",
color="green")
)
These method prints by default & return None
from tinge import warn, error, info, success
warn("This is warning") # yellow bold text
info("This is to inform") # blue bold text
success("Success", strong=False) # green normal text
error("Error: File Missing") # red bold text
from tinge import line
line() # a horizontal line
line(text="Hello") # horizontal line with text in middle
line(text="Hello", color="red") # red color line with text in middle
help(line) # for more info
Foreground(color) | Background(on_color) |
---|---|
Black | Grey |
Red | Red |
Green | Green |
Yellow | Yellow |
Blue | Blue |
Magenta | Magenta |
Cyan | Cyan |
White | White |
Style | Bold | Italic | Underline |
---|
Function | Parameters | Use for |
---|---|---|
colored |
text, color, on_color | Colored text |
italic |
text, color, on_color | Italic colored text |
underline |
text, color, on_color | Underlined colored text |
bold |
text, color, on_color | Bold colored text |
warn |
text | Yellow Bold Warning text |
error |
text | Red Bold Error text |
info |
text | Blue Bold Information text |
success |
text | Green Bold Success text |
colorama
is no longer a requirementline
method for horizontal linescprint
method to directly print colored text