This namespace contains everything related to the ansi color codes packed in nested namespaces for
readability and use. The nested namespaces that are used in this class to organize the colors are:
namespace formats
- This namespace holds format codes such as bold or dim
- reset
- bold
- dim
- underline
- blink
- invert
- strike_out
- disable_bold
- revert_intensity
- disable_underline
- disable_blink
- disable_invert
- disable_strike_out
- clear_to_end
namespace basic_colors
- This namespace holds the ansi codes for the non-bold/bright
variants of colors
namespace foreground
- This nested namespace holds the color codes that
only deal with the foreground colors for basic colors
- black
- red
- green
- yellow
- blue
- magenta
- cyan
- white
namespace background
- This nested namespace holds the color codes that
only deal with the foreground colors for basic colors
- black
- red
- green
- yellow
- blue
- magenta
- cyan
- white
namespace combos
- This nested namespace holds the color codes that
only deal with the color combinations for all the basic variants of color
codes for both foreground and background.
namespace bright_colors
- This namespace holds the ansi codes for the bold/bright
variants of colors
namespace foreground
- This nested namespace holds the color codes that
only deal with the foreground colors for bright colors
- black
- red
- green
- yellow
- blue
- magenta
- cyan
- white
namespace background
- This nested namespace holds the color codes that
only deal with the foreground colors for bright colors
- black
- red
- green
- yellow
- blue
- magenta
- cyan
- white
namespace combos
- This nested namespace holds the color codes that
only deal with the color combinations for all the bright variants of color
codes for both foreground and background.
namespace Tag
- For this namespace, everything listed above in regards to only
foreground, only background, as well as all the color combinations are wrapped in the same
naming scheme in function form. The functions in this namespace return a std::string. The
returned string wraps the text by prepending the color code to the text and by appending the
'reset' format code to isolate the color to only the text passed in.
For Instance:
#include <serenity/Color/Color.h>
#include <iostream>
using namespace serenity::se_colors;
std::cout << Tag::Grey("This text will now have a grey color");
std::cout << Tag::BrightRedOnYellow("This text will now have a bright red color text on a yellow background");
For a full list of functions, see below: