color
color(*args, auto_end=True)
¶
Color a message.
Format the arguments by replacing the colors in the Colors class. For instance::
color('{blue}Hello there{end}\n{yellow}WARNING')
Parameters:
Name | Type | Description | Default |
---|---|---|---|
args |
str
|
Strings to color |
()
|
auto_end |
bool
|
Add a string to end coloring |
True
|
Returns:
Type | Description |
---|---|
str
|
A formatted message. |
Source code in m/color/colors.py
color_disabled()
¶
Check for environment variable NO_COLOR.
Utilities that format strings with color should call this function to determine if the user wants color in the final output.
Returns:
Type | Description |
---|---|
bool
|
True if it exists and its set to true or 1. |