Metadata-Version: 2.4
Name: blendercolors
Version: 0.1.2
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. Based on the classic bcolors snippet from Blender 3D source code.

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

## Features

- Simple ANSI color codes
- Cross-platform (works in most modern terminals)
- Lightweight and *dependency-free*

## 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 anytime your can disable all coloring without remove previos written, just place at top of program:
bcolors.disable()

```

![Demo](https://raw.githubusercontent.com/tdhster/blendercolors/main/example.png)

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

ANSI codes:
```python

    HEADER = '\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'
```

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
