A text style consisting of foreground and background colors and emphasis.
Declared in <fmt/color.h>
class text_style;
| Name | Description |
|---|---|
text_style [constructor] | Constructs a text style with the given emphasis and no colors set. |
get_background | Returns the background color of this style. |
get_emphasis | Returns the emphasis of this style. |
get_foreground | Returns the foreground color of this style. |
has_background | Reports whether this style has a background color set. |
has_emphasis | Reports whether this style has any emphasis set. |
has_foreground | Reports whether this style has a foreground color set. |
operator|= | Merges rhs into this style, combining their colors and emphases. |
operator== | Compares this style with rhs for equality. |
operator!= | Compares this style with rhs for inequality. |
| Name | Description |
|---|---|
fmt::bg | Creates a text style from the background color. |
fmt::fg | Creates a text style from the foreground (text) color. |
fmt::operator| | Combines lhs and rhs into a new style with their colors and emphases merged. |
| Name | Description |
|---|---|
format | Formats arguments and returns the result as a string using ANSI escape sequences to specify text formatting. |
format | Formats args according to specifications in fmt, applying the text style ts, and returns the result as a std::wstring. |
operator| | Combines two emphases into a text style with both applied. |
print | Formats a string and prints it to stdout using ANSI escape sequences to specify text formatting. |
println | Formats a string and prints it to stdout followed by a newline, using ANSI escape sequences to specify text formatting. |
vformat | Formats args according to specifications in fmt, applying the text style ts, and returns the result as a std::wstring. |
vformat | Formats a string with the given text style using ANSI escape sequences and returns the result. |