color(color: str, text: str)-> set text colorbg_color(color: str, text: str)-> set text background colorstyle(style: str, text: str)-> set text style
Basic usage
# prints red text
print(color('red', 'some text'))Functions can be stacked on top of each other
# prints underlined, green text on black background
print(
style('underline',
bg_color('black',
color('green',
'some text'
)
)
)
)For commonly used cases you can define helper functions
# prints bold blue text
bb = lambda text: style('bold', color('blue', text))
print(bb('some text'))BLACKREDGREENYELLOWBLUEPURPLECYANWHITEBLACKREDGREENYELLOWBLUEPURPLECYANWHITE
BLACKREDGREENYELLOWBLUEPURPLECYANWHITEBLACKREDGREENYELLOWBLUEPURPLECYANWHITE
BOLDUNDERLINE
