xieite::term::invert_code()

Defined in header <xieite/io/term.hpp>

Returns a string which enables or disables the swapping of foreground and background colors of text when printed.


Declaration

[[nodiscard]] static constexpr std::string invert_code(bool x) noexcept;


Example

int main() {
	std::println(
		"{}{}Hello, {}world!",
		xieite::term::fg_code(255, 0, 0),
		xieite::term::bg_code(0, 0, 255),
		xieite::term::invert_code(true)
	);
}
Possible output:
Hello, world!