Metadata-Version: 2.4
Name: blendercolors
Version: 0.1.3
Summary: The simplest module for coloring terminal output via ansi codes. Originally from blender 3d source code.
Author-email: TDH <tdhster@gmail.com>
License: GPL-3.0-or-later
Project-URL: Homepage, https://github.com/tdhster/blendercolors
Keywords: ansi,terminal,colors,easy,gpl,class
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# Blendercolors

A simple module for coloring terminal output via ANSI codes with a few colors. 

Works on all terminals with ANSI. (Linux, MacOS, modern Windows)

Lightweight and *dependency-free*

### What you get
Just put inside f-string in print:
![Demo](https://raw.githubusercontent.com/tdhster/blendercolors/main/example.png)


## Installation

```bash
pip install blendercolors
```

## Usage

```python
from blendercolors import bcolors

print(f"{bcolors.WARNING}Yellow color for warnings{bcolors.ENDC}")
print(f"Three OK colors")
print(f" {bcolors.OKGREEN}green{bcolors.ENDC}, \
         {bcolors.OKBLUE}blue{bcolors.ENDC} and \
         {bcolors.OKCYAN}cyan{bcolors.ENDC}")
print(f"{bcolors.FAIL}Red for error texts{bcolors.ENDC}")
# and others color and formatting.
```

Start coloring text with defined choiced color, finish coloring by bcolors.ENDC

ANSI codes:
```python

    HEADEanytimeR = '\033[95m'
    OKBLUE = '\033[94m'
    OKCYAN = '\033[96m'
    OKGREEN = '\033[92m'
    WARNING = '\033[93m'
    FAIL = '\033[91m'
    ENDC = '\033[0m'
    BOLD = '\033[1m'
    UNDERLINE = '\033[4m'
```

Anytime your can disable all coloring without removing previos written code, just place at top of program:

```python
bcolors.disable()
```

Based on the classic bcolors snippet popularized by Blender and Stack Overflow.

Inspired by stackoverflow post: https://stackoverflow.com/questions/287871/how-do-i-print-colored-text-to-the-terminal
