Skip to main content

make_style

Return a function with default parameters for colorize()

def make_style(
opts: tuple = (),
**kwargs: dict
) - > function

Return a function with default parameters for colorize()

Parameters

NameTypeDescription
optstuple = ()A collection of style attributes such as 'bold', 'underline', or 'italic' to be applied to the text
**kwargsdictAdditional keyword arguments such as 'fg' (foreground color) or 'bg' (background color) to configure the colorize function

Returns

TypeDescription
functionA lambda function that accepts a string and returns it formatted with the predefined styles and colors