2#ifndef _CONSOLIX_COLOR_MANIPULATOR_HPP_INCLUDED
3#define _CONSOLIX_COLOR_MANIPULATOR_HPP_INCLUDED
10#ifndef CONSOLIX_DEFAULT_COLOR
11#define CONSOLIX_DEFAULT_COLOR consolix::TextColor::LightGray
33# if CONSOLIX_USE_LOGIT == 0
34# if defined(_WIN32) || defined(_WIN64)
35 HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
38 if (isatty(STDOUT_FILENO)) {
39 std::cout <<
"\033[0m";
A utility class for managing text color in streams.
TextColor color() const
Retrieves the current text color.
TextColor m_color
The current text color.
ColorManipulator(TextColor color)
Constructor.
~ColorManipulator()
Destructor that resets the text color to the default.
#define CONSOLIX_DEFAULT_COLOR
Default text color for console output.
< Utility modules and helpers.
ColorManipulator color(TextColor color)
Creates a color manipulator for use in output streams.
TextColor
Represents text colors for console output.
const char * to_c_str(const TextColor &color)
Converts a TextColor to an ANSI escape code string.
std::ostream & operator<<(std::ostream &os, const ColorManipulator &manip)
Overloads the stream operator to apply text color.