Colors for terminal styling
Project description
crgb
The crgb module provides a comprehensive set of color manipulation tools in Python. It includes a variety of static and dynamic colors, as well as functions to create and mix colors. This module is designed for developers who want to work with colors in a flexible and dynamic way.
Overview
Class: Colors
The Colors class contains:
- 54 color variables representing different colors.
- 3 lists:
static_colors: Colors that are static (e.g., 'red') and cannot be faded.dynamic_colors: Colors that can be faded (e.g., 'blue_to_purple').all_colors: A combination of both static and dynamic colors.
Functions
The Colors class provides the following functions:
-
StaticRGB(r: int, g: int, b: int) -> str: Create a fixed/static color using RGB values. -
DynamicRGB(r1: int, g1: int, b1: int, r2: int, g2: int, b2: int) -> list: Create a faded/dynamic color (coming soon). -
StaticMIX(colors: list, _start: bool = True) -> str: Mix two or more static colors. -
DynamicMIX(colors: list): Mix two or more dynamic colors. -
Symbol(symbol: str, col: str, col_left_right: str, left: str = '[', right: str = ']') -> str: Create a colored symbol (e.g., '[!]').
Color Variables
Dynamic Colors
black_to_whiteblack_to_redblack_to_greenblack_to_bluewhite_to_blackwhite_to_redwhite_to_greenwhite_to_bluered_to_blackred_to_whitered_to_yellowred_to_purplegreen_to_blackgreen_to_whitegreen_to_yellowgreen_to_cyanblue_to_blackblue_to_whiteblue_to_cyanblue_to_purpleyellow_to_redyellow_to_greenpurple_to_redpurple_to_bluecyan_to_greencyan_to_bluered_to_bluered_to_greengreen_to_bluegreen_to_redblue_to_redblue_to_greenrainbow
Static Colors
redgreenbluewhiteblackgrayyellowpurplecyanorangepinkturquoiselight_graydark_graylight_redlight_greenlight_bluedark_reddark_greendark_bluereset
Usage
To use the crgb module, simply import it and create colors using the provided functions. Here's an example:
from crgb import Colors
# Create a static color
static_color = Colors.StaticRGB(255, 0, 0) # Red
# Create a dynamic color (when available)
# dynamic_color = Colors.DynamicRGB(255, 0, 0, 0, 0, 255) # Fades from red to blue
# Mix static colors
mixed_static = Colors.StaticMIX([Colors.red, Colors.blue])
# Create a colored symbol
colored_symbol = Colors.Symbol('!', Colors.red, Colors.white)
Installation
To install the crgb module, simply clone the repository or download the module file and include it in your project.
Contributing
Contributions are welcome! If you have suggestions for improvements or new features, feel free to open an issue or submit a pull request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
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
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 crgb-1.0.2.tar.gz.
File metadata
- Download URL: crgb-1.0.2.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca2e4d9478b2e789be29d83172b3f70d715ab153cc0795b25de6050e16619656
|
|
| MD5 |
82989c34bd26d46d0df9508398056a33
|
|
| BLAKE2b-256 |
c0ca8a3221dd7b3dec945e53e445ffc98a873e48e6c13a7e03ad04c47bdd1071
|
File details
Details for the file crgb-1.0.2-py3-none-any.whl.
File metadata
- Download URL: crgb-1.0.2-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f049003f63db8cd201c74706804f9587446b20c31e8ff607143e729d99efd423
|
|
| MD5 |
1e41ba31c8e6dd5f14d92ec774cd5791
|
|
| BLAKE2b-256 |
3ab86e33bb5c1dee12cd3e29805539de8c69b62057b1db57724d9deab7893610
|