A package for colorizing and styling text
Project description
yulm-styled
This Python module provides utilities for colorizing text with various effects such as faded colors and rainbow colors.
Usage
To use this module, import it into your Python script:
import sys
import time
from colorized_text import Color, FadedColor, RainbowColor, colorize_text, fade_text, rainbow_text, fade_color
Colorizing Text
To colorize a text with a specific color, use the colorize_text function:
colored_text = colorize_text("Hello, World!", Color.RED)
print(colored_text)
Output:
Hello, World! (with the color)
Faded Text
To apply faded color to a text, use the fade_text function:
faded_text = fade_text("Hello, World!", FadedColor.YELLOW)
print(faded_text)
Output:
Hello, World! (Faded out Color)
Rainbow Text
To apply rainbow color to a text, use the rainbow_text function:
rainbow_text = rainbow_text("Hello, World!")
print(rainbow_text)
Output:
Hello, World! (Rainbow Colors)
Fading Color
To fade the color of a text from one color to another, use the fade_color function:
fade_color("Hello, World!", "RED", "BLUE", duration=2.0)
Output:
Hello, World! (From Red to Blue in a nice gradiend)
Color Class
The Color class provides ANSI escape codes for standard text colors. It includes the following color constants:
Color.RESETColor.BLACKColor.REDColor.GREENColor.YELLOWColor.BLUEColor.MAGENTAColor.CYANColor.WHITEColor.GRAY
FadedColor Class
The FadedColor class provides ANSI escape codes for faded text colors. It includes the following color constants:
FadedColor.BLACKFadedColor.REDFadedColor.GREENFadedColor.YELLOWFadedColor.BLUEFadedColor.MAGENTAFadedColor.CYANFadedColor.WHITEFadedColor.GRAY
RainbowColor Class
The RainbowColor class provides ANSI escape codes for rainbow text colors. It includes the following method:
RainbowColor.get_color(index): Returns the ANSI escape code for the color at the specified index in the rainbow sequence.
fade_color Function
The fade_color function fades the specified text from left to right with a gradual color change. The user can specify the color names (e.g., "RED", "BLUE"). The number of steps is calculated based on the duration.
fade_color(text, from_color_name, to_color_name, duration=1.0)
text: The text to be faded.from_color_name: The name of the starting color.to_color_name: The name of the ending color.duration: The duration of the fade animation in seconds (default: 1.0).
License
This module is released under the MIT License. See LICENSE for more information.
Project details
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 yulm-styled-1.0.0.tar.gz.
File metadata
- Download URL: yulm-styled-1.0.0.tar.gz
- Upload date:
- Size: 2.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79927f80ee975bc25196f2331dc409d5c2054569b7b03aff9cc07a92abb0ea1d
|
|
| MD5 |
ca8244608a5ebb645bcb63d6879af8ff
|
|
| BLAKE2b-256 |
7658e5a13eab457feb4d2bf2ac09a4ca1c4a451f7787760f3f7122c293f425d4
|
File details
Details for the file yulm_styled-1.0.0-py3-none-any.whl.
File metadata
- Download URL: yulm_styled-1.0.0-py3-none-any.whl
- Upload date:
- Size: 2.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ef05fa17908cf4037afac5695c84c5ed9992573da81c821985be6dcbad62244
|
|
| MD5 |
1c6aad0ed998f9cddc8b1c640195722a
|
|
| BLAKE2b-256 |
d2f01ef5b51c3fbf8dce75891784748bc2132906017f9d3409c322d6036856ab
|