FormatColor
exprint.formatter.FormatColor
FormatColor(formatter: Formatter, color: ANSIColors)
Class for coloring values.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
ANSIColors
|
ANSI color code |
required |
Source code in exprint/formatter.py
value
value(value: Format) -> FormatColor
Adds the value to the formatter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Format
|
Value to add. |
required |
Returns:
| Type | Description |
|---|---|
FormatColor
|
Itself |
Examples:
>>> f = Formatter()
>>> value = f.format_value().value(10.286)
>>> f.format_color(ANSIColors.BLUE).value(value)