inksplash
is a Python package that provides a versatile set of utilities for colorizing and styling text output in terminal environments.
- inksplash
- Table of Contents
- Installation
- Usage
- Features
- Available styles and functions
- Contributing
- License
You can install inksplash
via pip:
pip install inksplash
First, you need to import the chameleon
module from the inksplash
package:
from inksplash import chameleon
print(chameleon.bg_bright_green(chameleon.italic(chameleon.black("Hello world"))))
Output:
This example demonstrates how to use chameleon
functions from inksplash
to colorize and style text output. In this case, it applies a bright green background, italic style, and black text color to the string "Hello world".
- Easy-to-use API for applying various text styles and colors.
- Supports a wide range of styling options, including bold, italic, underline, foreground and background colors, etc.
- Compatible with ANSI terminal escape sequences, ensuring compatibility across different terminal emulators and platforms.
The following are the functions that are available for text styles and colors.
-
blue
Applies a blue color to the text.
Parameters:
-
value
(str): The input text.
Returns:
- str: The input text with blue color.
-
-
green
Applies a green color to the text.
Parameters:
-
value
(str): The input text.
Returns:
- str: The input text with green color.
-
-
yellow
Applies a yellow color to the text.
Parameters:
-
value
(str): The input text.
Returns:
- str: The input text with yellow color.
-
-
white
Applies a white color to the text.
Parameters:
-
value
(str): The input text.
Returns:
- str: The input text with white color.
-
-
purple
Applies a purple color to the text.
Parameters:
-
value
(str): The input text.
Returns:
- str: The input text with purple color.
-
-
red
Applies a red color to the text.
Parameters:
-
value
(str): The input text.
Returns:
- str: The input text with red color.
-
-
cyan
Applies a cyan color to the text.
Parameters:
-
value
(str): The input text.
Returns:
- str: The input text with cyan color.
-
-
black
Applies a black color to the text.
Parameters:
-
value
(str): The input text.
Returns:
- str: The input text with black color.
-
-
bold
Applies bold style to the text.
Parameters:
-
value
(str): The input text.
Returns:
- str: The input text with bold style.
-
-
underline
Applies underline style to the text.
Parameters:
-
value
(str): The input text.
Returns:
- str: The input text with underline style.
-
-
italic
Applies italic style to the text.
Parameters:
-
value
(str): The input text.
Returns:
- str: The input text with italic style.
-
strikethrough
Applies strikethrough style to the text.
Parameters:
-
value
(str): The input text.
Returns:
- str: The input text with strikethrough style.
-
bright_black
Applies a bright black color to the text.
Parameters:
-
value
(str): The input text.
Returns:
- str: The input text with bright black color.
-
-
bright_red
Applies a bright red color to the text.
Parameters:
-
value
(str): The input text.
Returns:
- str: The input text with bright red color.
-
-
bright_green
Applies a bright green color to the text.
Parameters:
-
value
(str): The input text.
Returns:
- str: The input text with bright green color.
-
-
bright_yellow
Applies a bright yellow color to the text.
Parameters:
-
value
(str): The input text.
Returns:
- str: The input text with bright yellow color.
-
-
bright_blue
Applies a bright blue color to the text.
Parameters:
-
value
(str): The input text.
Returns:
- str: The input text with bright blue color.
-
-
bright_purple
Applies a bright purple color to the text.
Parameters:
-
value
(str): The input text.
Returns:
- str: The input text with bright purple color.
-
-
bright_cyan
Applies a bright cyan color to the text.
Parameters:
-
value
(str): The input text.
Returns:
- str: The input text with bright cyan color.
-
-
bright_white
Applies a bright white color to the text.
Parameters:
-
value
(str): The input text.
Returns:
- str: The input text with bright white color.
-
-
bg_black
Applies a black background color to the text.
Parameters:
-
value
(str): The input text.
Returns:
- str: The input text with black background color.
-
-
bg_red
Applies a red background color to the text.
Parameters:
-
value
(str): The input text.
Returns:
- str: The input text with red background color.
-
-
bg_green
Applies a green background color to the text.
Parameters:
-
value
(str): The input text.
Returns:
- str: The input text with green background color.
-
-
bg_yellow
Applies a yellow background color to the text.
Parameters:
-
value
(str): The input text.
Returns:
- str: The input text with yellow background color.
-
-
bg_blue
Applies a blue background color to the text.
Parameters:
-
value
(str): The input text.
Returns:
- str: The input text with a blue background color.
-
-
bg_purple
Applies a purple background color to the text.
Parameters:
-
value
(str): The input text.
Returns:
- str: The input text with a purple background color.
-
-
bg_cyan
Applies a cyan background color to the text.
Parameters:
-
value
(str): The input text.
Returns:
- str: The input text with a cyan background color.
-
-
bg_white
Applies a white background color to the text.
Parameters:
-
value
(str): The input text.
Returns:
- str: The input text with a white background color.
-
-
bg_bright_black
Applies a bright black background color to the text.
Parameters:
-
value
(str): The input text.
Returns:
- str: The input text with a bright black background color.
-
-
bg_bright_red
Applies a bright red background color to the text.
Parameters:
-
value
(str): The input text.
Returns:
- str: The input text with a bright red background color.
-
-
bg_bright_green
Applies a bright green background color to the text.
Parameters:
-
value
(str): The input text.
Returns:
- str: The input text with a bright green background color.
-
-
bg_bright_yellow
Applies a bright yellow background color to the text.
Parameters:
-
value
(str): The input text.
Returns:
- str: The input text with a bright yellow background color.
-
-
bg_bright_blue
Applies a bright blue background color to the text.
Parameters:
-
value
(str): The input text.
Returns:
- str: The input text with a bright blue background color.
-
-
bg_bright_purple
Applies a bright purple background color to the text.
Parameters:
-
value
(str): The input text.
Returns:
- str: The input text with a bright purple background color.
-
-
bg_bright_cyan
Applies a bright cyan background color to the text.
Parameters:
-
value
(str): The input text.
Returns:
- str: The input text with a bright cyan background color.
-
-
bg_bright_white
Applies a bright white background color to the text.
Parameters:
-
value
(str): The input text.
Returns:
- str: The input text with a bright white background color.
-
You can read more in the documentation.
Contributions to inksplash
are welcome! Feel free to submit bug reports, feature requests, or pull requests on GitHub.
This project is licensed under the MIT License - see the LICENSE file for details.