logalpha.color
Color
Associates a name (str) with its corresponding foreground and background (str) ANSI codes. Construct one or more instances using the factory methods.
from_name
Lookup ANSI codes by name.
>>> red = Color.from_name('red') >>> red Color(name='red', foreground='[31m', background='[41m')
from_names
Returns a tuple of Color instances using the singular from_name() factory.
from_name()
>>> colors = Color.from_names(['blue', 'green']) >>> colors [Color(name='blue', foreground='[34m', background='[44m'), Color(name='green', foreground='[32m', background='[42m')]
NAMES
Names of supported colors to map to ANSI codes.
ANSI_RESET
ANSI reset code.
ANSI_COLORS
Dictionary of all ANSI code sequences.
For convenience and readability, a set of global named instances are included for all of the colors.
BLACK
RED
GREEN
YELLOW
BLUE
MAGENTA
CYAN
WHITE
logalpha.level
logalpha.message