tinycolor is a tiny python2 and python3 standalone module for color output on unix terminals. It works by appending ANSI escape codes to a given string.
Just call tinycolor.color.COLOR_NAME(string)
. Examples:
from tinycolor import color as c
print("Hey, this is {}!".format(c.green("cool")))
# Will print a green "cool"
print("It also works with {} colors".format(c.green_on_blue("background")))
# Will print "background" in green text on blue background
print("And with {} colors".format(c.bright_green("bright")))
# Will print a bright green "bright"
black
red
green
yellow
blue
magenta
cyan
white
bright_
prefix can be added to any color
pip install tinycolor
Public domain