Skip to content

rbaron/tinycolor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

tinycolor

tinycolor usage

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.

Usage

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"

Available colors

  • black
  • red
  • green
  • yellow
  • blue
  • magenta
  • cyan
  • white
  • bright_ prefix can be added to any color

Installation

pip install tinycolor

License

Public domain

About

A tiny python2 and python3 module for printing in colors

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages