A better way to output colored text.
Project description
ColorStr
A python lib, A better way. Rainbowlize your Terminal
ColorStr is a library simplifies outputting color and readable!
How To Install
Still registering in pypi. For now, download from Releases
How To Use
This is usually how you print a colored output.
print("\033[31mIm red") #Prints a red line
print("\033[32mIm green") #Prints a green line.
As you can see, this is still readable. But when the line is long, it's not going to be human-friendly. Like this:
print("\033[32;1mLorem Ipsum!\033[0m\n\033[31;1mL\033[0;31moremipsum")
#Prints:
#Lorem Ipsum (green, bold)
#L(red,bold) oremipsum (red, non-bold)
This is ColorStr
from ColorStr import parse
print(parse("§rRed Line!")) #Prints red line
print(parse("§gGreen Line!")) #Prints green line
print(parse("§GLorem Ipsum!"))
print(parse("§RL§0§roremipsum"))
This is not only easier to use, it's also much more readable.
List of formattings
*Note : not all terminal supports formatting. Please check before using it in your project
| Color Name | Foreground | Background |
|---|---|---|
| Black | §k | ƒk |
| Red | §r | ƒr |
| Green | §g | ƒg |
| Yellow | §y | ƒy |
| Blue | §b | ƒb |
| Megenta | §m | ƒm |
| Cyan | §c | ƒc |
| White | §w | ƒw |
| Bold Black | §K | ƒK |
| Bold Red | §R | ƒR |
| Bold Green | §G | ƒG |
| Bold Yellow | §Y | ƒY |
| Bold Blue | §B | ƒB |
| Bold Megenta | §M | ƒM |
| Bold Cyan | §C | ƒC |
| Bold White | §W | ƒW |
| Formatting | Code |
|---|---|
| Reset All Formatting | §0 |
| Bold (or brighter color) | §1 |
| Darken | §2 |
| Italic | §3 |
| Underlined | §4 |
| Blinking | §5 |
| Un-Inverse Color | §6 |
| Inverse Color (Forground and Background) | §7 |
| Hide Charactors | §8 |
| Crossover | §9 |
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 Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ColorStr-1.0-py2-none-any.whl.
File metadata
- Download URL: ColorStr-1.0-py2-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.1.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/2.7.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba877562af101eb50aa5a7ccbcb5108a97ec1edb4547ab6392d4a1a19b70ce7a
|
|
| MD5 |
042b6c1911f7e973529f182dacef786d
|
|
| BLAKE2b-256 |
d7c0668963971d39b7dbc0fd4b63b5319f8acc540ef0342357d78cc65901a79c
|