RainbowChar is a lib that stylizes text by formatting in ANSI escape code. It only supports true color terminals.
Use the package manager pip to install rainbow-char-lib.
pip install rainbowchar
A simple example of a hello world.
from rainbowchar.rainbow import paint
def showcase():
hello = paint('hello', foreground='#00FF28', italic=True)
world = paint('world!', foreground='#00FF28', italic=True)
print('{} {}'.format(hello, world))
print(paint(':D', foreground='#000000', background='#FFFF0A', bold=True))
if __name__ == '__main__':
showcase()
Function paint parameter list.
Parameter | Description | Type | Default |
---|---|---|---|
text | Text to stylize | str | None |
foreground | Hexadecimal color of foreground | str | None |
background | Hexadecimal color of background | str | None |
bold | Bold flag | bool | False |
italic | Italic flag | bool | False |
underline | Underline flag | bool | False |