fmt::text_style

A text style consisting of foreground and background colors and emphasis.

Synopsis

Declared in <fmt/color.h>

class text_style;

Member Functions

NameDescription
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.

Friends

NameDescription
fmt::bgCreates a text style from the background color.
fmt::fgCreates a text style from the foreground (text) color.
fmt::operator|Combines lhs and rhs into a new style with their colors and emphases merged.

Non-Member Functions

NameDescription
formatFormats arguments and returns the result as a string using ANSI escape sequences to specify text formatting.
formatFormats 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.
printFormats a string and prints it to stdout using ANSI escape sequences to specify text formatting.
printlnFormats a string and prints it to stdout followed by a newline, using ANSI escape sequences to specify text formatting.
vformatFormats args according to specifications in fmt, applying the text style ts, and returns the result as a std::wstring.
vformatFormats a string with the given text style using ANSI escape sequences and returns the result.