just another mod to print strings in 256 colors in the terminal.
Project description
string-color
string-color is just another python module for coloring strings in print statements.
Installation
$ pip install string-color
Python Module Usage
from stringcolor import *
# a few examples without background colors.
# for color names see CLI usage below.
print(cs("here we go", "orchid"))
print(cs("away to space!", "DeepPink3"))
print(cs("final fantasy", "#ffff87"))
print()
# bold and underline also available.
print(cs("purple number 4, bold", "purple4").bold())
print(cs("blue, underlined", "blue").underline())
print(bold("bold AND underlined!").underline().cs("red", "gold"))
print()
# yellow text with a red background.
# color names, hex values, and ansi numbers will work.
print(cs("warning!", "yellow", "#ff0000"))
print()
# concat
print(cs("wild", "pink")+" stuff")
print("nothing "+cs("something", "DarkViolet2", "lightgrey6"))
CLI Usage
positional arguments:
color show info for a specific color:
$ string-color red
$ string-color '#ffff87'
$ string-color *grey* # wildcards acceptable
optional arguments:
-h, --help show this help message and exit
-x, --hex show hex values
-r, --rgb show rgb values
--hsl show hsl values
-a, --alpha sort by name
-v, --version show program's version number and exit
$ string-color
display a list of all 256 colors
$ string-color yellow
show color info for the color yellow
$ string-color "#ff0000"
show color info for the hex value #ff0000
$ string-color *grey*
show all colors with "grey" in the name. also works with "grey*" and "*grey"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
string-color-0.3.3.tar.gz
(10.3 kB
view hashes)
Built Distribution
Close
Hashes for string_color-0.3.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a03c3b8469215cdb972c4c51f63d22ce8d77ba9b450d25030c96f6483479d03b |
|
MD5 | 9cfa9933eec9526666ffa79dbf9f1ade |
|
BLAKE2b-256 | cf7f3feecc89d3546625935ef3cc2d68d88f02dd18846bbcd5f291a522ce3f2f |