awsc.termui.color.Color

class awsc.termui.color.Color(palette, code, background=None)

A Color is a specific code in a palette. Color objects can be used to quickly colorize strings.

Attributes:
paletteawsc.termui.color.Palette

The Palette where this color can be found.

codeobject

The code of the foreground color associated with this color in the palette.

backgroundobject

The code of the background color associated with this color in the palette. If None, the color of the background should not be changed.

Methods

__call__(string[, bold])

Colorize a string with this Color.

__init__(palette, code, background=None)

Initializes a Color object.

Parameters:
paletteawsc.termui.color.Palette

The Palette where this color can be found.

codeobject

The code of the foreground color associated with this color in the palette.

backgroundobject, optional

The code of the background color associated with this color in the palette. If None, the color of the background should not be changed.

Methods

__init__(palette, code[, background])

Initializes a Color object.