warg.colors.css_colors.color

warg.colors.css_colors.color(s, fg=None, bg=None, style=None)[source]

Add ANSI colors and styles to a string.

Parameters:
  • style

  • s (str) – String to format.

  • fg (str|int|tuple) – Foreground color specification.

  • bg (str|int|tuple) – Background color specification.

Returns:

Formatted string.

Return type:

str (or unicode in Python 2, if s is unicode)