The Rainbow module provides functions to add color to text in the terminal or prompt.
This package aims to make it easier to use colors in the prompt with Python.
Say goodbye to those horrible-to-remember character sets that we had to use to insert colors into the prompt. With this module, coloring the prompt will be quick and easy.
You can install Rainbow via pip:
- pip install rainbow_prompt
from rainbow import cstring, rc_stringcstring("Hello, World!", "green")colored_text = rc_string("Hello, World!", "red")
print(colored_text)The following color names are available:
- black
- red
- green
- yellow
- blue
- magenta
- cyan
- white
Available Backgrounds:
- bg_black
- bg_red
- bg_green
- bg_yellow
- bg_blue
- bg_magenta
- bg_ciano
- bg_white
Available Styles:
- style_negrito
- style_sublinhado
- style_invertido
Note: Make sure to use these color names exactly as specified.
from rainbow import cstring
cstring("This is a colored prompt.", "blue")
cstring("Error!", "red")
cstring("Warning!", "yellow")