https://github.com/kokofixcomputers/printed-colors
https://github.com/kokofixcomputers/printed-colors
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/kokofixcomputers/printed-colors
- Owner: kokofixcomputers
- Created: 2024-12-01T19:27:43.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-20T21:25:46.000Z (over 1 year ago)
- Last Synced: 2025-04-08T22:48:50.196Z (about 1 year ago)
- Language: Python
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# Printed Colors
### Installation
To install, just simply run:
```bash
pip install printedcolors
```
### Usage
The usage is simple. You can use it like this in normal prints:
```python
import printedcolors
print(printedcolors.Color.fg.red + printedcolors.Color.bold + "I'm red and bold!" + printedcolors.Color.reset)
```
But if you want to keep it even more simple, You can do it like this:
```python
import printedcolors
Color = printedcolors.Color
fg = Color.fg
print(fg.red + "Hi! I'm red!" + Color.reset)
```
Color.reset is recommended to not affect future prints.
Both Color and Colour can be used.
### Supported Colours/Colors
FG (Foreground) Colors/Color:
| Color Name | Code Example |
|---------------|--------------------------|
| Black | `Colour.fg.black` |
| Red | `Colour.fg.red` |
| Green | `Colour.fg.green` |
| Yellow | `Colour.fg.yellow` |
| Blue | `Colour.fg.blue` |
| Magenta | `Colour.fg.magenta` |
| Cyan | `Colour.fg.cyan` |
| Light Grey | `Colour.fg.lightgrey` |
| Dark Grey | `Colour.fg.darkgrey` |
| Light Red | `Colour.fg.lightred` |
| Light Green | `Colour.fg.lightgreen` |
| Light Yellow | `Colour.fg.lightyellow` |
| Light Blue | `Colour.fg.lightblue` |
| Light Magenta | `Colour.fg.lightmagenta` |
| Light Cyan | `Colour.fg.lightcyan` |
BG (Background) Colours/Color:
| Color Name | Code Example |
|------------|-----------------------|
| Black | `Colour.bg.black` |
| Red | `Colour.bg.red` |
| Green | `Colour.bg.green` |
| Yellow | `Colour.bg.yellow` |
| Blue | `Colour.bg.blue` |
| Magenta | `Colour.bg.magenta` |
| Cyan | `Colour.bg.cyan` |
| Light Grey | `Colour.bg.lightgrey` |
Misc (Other):
| Style Name | Code Example |
|---------------|------------------------|
| Bold | `Colour.bold` |
| Dim | `Colour.dim` |
| Underline | `Colour.underline` |
| Reverse | `Colour.reverse` |
| Strikethrough | `Colour.strikethrough` |
| Invisible | `Colour.invisible` |
| Reset | `Colour.reset` |
As a reminder, both `Colour` and `Color` can be used. As both is defined in the library.