Skip to main content

colorize

Return your text, enclosed in ANSI graphics codes.

def colorize(
text: string = "",
opts: tuple|list = (),
**kwargs: dict
) - > string

Return your text, enclosed in ANSI graphics codes.

Parameters

NameTypeDescription
textstring = ""The string content to be styled with ANSI graphics codes.
opts`tuplelist` = ()
**kwargsdictKeyword arguments supporting 'fg' (foreground color) and 'bg' (background color) using standard color names.

Returns

TypeDescription
stringThe text wrapped in ANSI escape sequences for styling, or the RESET code if no parameters are provided.