WireCellToolkit
Wire Cell Simulation, Signal Process and Reconstruction Toolki for Liquid Argon Detectors
color.h File Reference
#include "format.h"
Include dependency graph for color.h:

Go to the source code of this file.

Classes

struct  rgb
 
struct  internal::color_type
 
union  internal::color_type::color_union
 
class  text_style
 
struct  internal::ansi_color_escape< Char >
 
struct  internal::is_string< std::FILE * >
 
struct  internal::is_string< const std::FILE * >
 

Namespaces

 internal
 

Enumerations

enum  color : uint32_t {
  color::alice_blue = 0xF0F8FF, color::antique_white = 0xFAEBD7, color::aqua = 0x00FFFF, color::aquamarine = 0x7FFFD4,
  color::azure = 0xF0FFFF, color::beige = 0xF5F5DC, color::bisque = 0xFFE4C4, color::black = 0x000000,
  color::blanched_almond = 0xFFEBCD, color::blue = 0x0000FF, color::blue_violet = 0x8A2BE2, color::brown = 0xA52A2A,
  color::burly_wood = 0xDEB887, color::cadet_blue = 0x5F9EA0, color::chartreuse = 0x7FFF00, color::chocolate = 0xD2691E,
  color::coral = 0xFF7F50, color::cornflower_blue = 0x6495ED, color::cornsilk = 0xFFF8DC, color::crimson = 0xDC143C,
  color::cyan = 0x00FFFF, color::dark_blue = 0x00008B, color::dark_cyan = 0x008B8B, color::dark_golden_rod = 0xB8860B,
  color::dark_gray = 0xA9A9A9, color::dark_green = 0x006400, color::dark_khaki = 0xBDB76B, color::dark_magenta = 0x8B008B,
  color::dark_olive_green = 0x556B2F, color::dark_orange = 0xFF8C00, color::dark_orchid = 0x9932CC, color::dark_red = 0x8B0000,
  color::dark_salmon = 0xE9967A, color::dark_sea_green = 0x8FBC8F, color::dark_slate_blue = 0x483D8B, color::dark_slate_gray = 0x2F4F4F,
  color::dark_turquoise = 0x00CED1, color::dark_violet = 0x9400D3, color::deep_pink = 0xFF1493, color::deep_sky_blue = 0x00BFFF,
  color::dim_gray = 0x696969, color::dodger_blue = 0x1E90FF, color::fire_brick = 0xB22222, color::floral_white = 0xFFFAF0,
  color::forest_green = 0x228B22, color::fuchsia = 0xFF00FF, color::gainsboro = 0xDCDCDC, color::ghost_white = 0xF8F8FF,
  color::gold = 0xFFD700, color::golden_rod = 0xDAA520, color::gray = 0x808080, color::green = 0x008000,
  color::green_yellow = 0xADFF2F, color::honey_dew = 0xF0FFF0, color::hot_pink = 0xFF69B4, color::indian_red = 0xCD5C5C,
  color::indigo = 0x4B0082, color::ivory = 0xFFFFF0, color::khaki = 0xF0E68C, color::lavender = 0xE6E6FA,
  color::lavender_blush = 0xFFF0F5, color::lawn_green = 0x7CFC00, color::lemon_chiffon = 0xFFFACD, color::light_blue = 0xADD8E6,
  color::light_coral = 0xF08080, color::light_cyan = 0xE0FFFF, color::light_golden_rod_yellow = 0xFAFAD2, color::light_gray = 0xD3D3D3,
  color::light_green = 0x90EE90, color::light_pink = 0xFFB6C1, color::light_salmon = 0xFFA07A, color::light_sea_green = 0x20B2AA,
  color::light_sky_blue = 0x87CEFA, color::light_slate_gray = 0x778899, color::light_steel_blue = 0xB0C4DE, color::light_yellow = 0xFFFFE0,
  color::lime = 0x00FF00, color::lime_green = 0x32CD32, color::linen = 0xFAF0E6, color::magenta = 0xFF00FF,
  color::maroon = 0x800000, color::medium_aquamarine = 0x66CDAA, color::medium_blue = 0x0000CD, color::medium_orchid = 0xBA55D3,
  color::medium_purple = 0x9370DB, color::medium_sea_green = 0x3CB371, color::medium_slate_blue = 0x7B68EE, color::medium_spring_green = 0x00FA9A,
  color::medium_turquoise = 0x48D1CC, color::medium_violet_red = 0xC71585, color::midnight_blue = 0x191970, color::mint_cream = 0xF5FFFA,
  color::misty_rose = 0xFFE4E1, color::moccasin = 0xFFE4B5, color::navajo_white = 0xFFDEAD, color::navy = 0x000080,
  color::old_lace = 0xFDF5E6, color::olive = 0x808000, color::olive_drab = 0x6B8E23, color::orange = 0xFFA500,
  color::orange_red = 0xFF4500, color::orchid = 0xDA70D6, color::pale_golden_rod = 0xEEE8AA, color::pale_green = 0x98FB98,
  color::pale_turquoise = 0xAFEEEE, color::pale_violet_red = 0xDB7093, color::papaya_whip = 0xFFEFD5, color::peach_puff = 0xFFDAB9,
  color::peru = 0xCD853F, color::pink = 0xFFC0CB, color::plum = 0xDDA0DD, color::powder_blue = 0xB0E0E6,
  color::purple = 0x800080, color::rebecca_purple = 0x663399, color::red = 0xFF0000, color::rosy_brown = 0xBC8F8F,
  color::royal_blue = 0x4169E1, color::saddle_brown = 0x8B4513, color::salmon = 0xFA8072, color::sandy_brown = 0xF4A460,
  color::sea_green = 0x2E8B57, color::sea_shell = 0xFFF5EE, color::sienna = 0xA0522D, color::silver = 0xC0C0C0,
  color::sky_blue = 0x87CEEB, color::slate_blue = 0x6A5ACD, color::slate_gray = 0x708090, color::snow = 0xFFFAFA,
  color::spring_green = 0x00FF7F, color::steel_blue = 0x4682B4, color::tan = 0xD2B48C, color::teal = 0x008080,
  color::thistle = 0xD8BFD8, color::tomato = 0xFF6347, color::turquoise = 0x40E0D0, color::violet = 0xEE82EE,
  color::wheat = 0xF5DEB3, color::white = 0xFFFFFF, color::white_smoke = 0xF5F5F5, color::yellow = 0xFFFF00,
  color::yellow_green = 0x9ACD32
}
 
enum  terminal_color : uint8_t {
  terminal_color::black = 30, terminal_color::red, terminal_color::green, terminal_color::yellow,
  terminal_color::blue, terminal_color::magenta, terminal_color::cyan, terminal_color::white,
  terminal_color::bright_black = 90, terminal_color::bright_red, terminal_color::bright_green, terminal_color::bright_yellow,
  terminal_color::bright_blue, terminal_color::bright_magenta, terminal_color::bright_cyan, terminal_color::bright_white
}
 
enum  emphasis : uint8_t { emphasis::bold = 1, emphasis::italic = 1 << 1, emphasis::underline = 1 << 2, emphasis::strikethrough = 1 << 3 }
 

Functions

FMT_CONSTEXPR text_style fg (internal::color_type foreground) FMT_NOEXCEPT
 
FMT_CONSTEXPR text_style bg (internal::color_type background) FMT_NOEXCEPT
 
FMT_CONSTEXPR text_style operator| (emphasis lhs, emphasis rhs) FMT_NOEXCEPT
 
template<typename Char >
FMT_CONSTEXPR ansi_color_escape< Char > internal::make_foreground_color (internal::color_type foreground) FMT_NOEXCEPT
 
template<typename Char >
FMT_CONSTEXPR ansi_color_escape< Char > internal::make_background_color (internal::color_type background) FMT_NOEXCEPT
 
template<typename Char >
FMT_CONSTEXPR ansi_color_escape< Char > internal::make_emphasis (emphasis em) FMT_NOEXCEPT
 
template<typename Char >
void internal::fputs (const Char *chars, FILE *stream) FMT_NOEXCEPT
 
template<>
void internal::fputs< wchar_t > (const wchar_t *chars, FILE *stream) FMT_NOEXCEPT
 
template<typename Char >
void internal::reset_color (FILE *stream) FMT_NOEXCEPT
 
template<>
void internal::reset_color< wchar_t > (FILE *stream) FMT_NOEXCEPT
 
template<typename S , typename Char = typename internal::char_t<S>::type>
void vprint (std::FILE *f, const text_style &ts, const S &format, basic_format_args< typename buffer_context< Char >::type > args)
 
template<typename String , typename... Args>
std::enable_if< internal::is_string< String >::value >::type print (std::FILE *f, const text_style &ts, const String &format_str, const Args &... args)
 
template<typename String , typename... Args>
std::enable_if< internal::is_string< String >::value >::type print (const text_style &ts, const String &format_str, const Args &... args)
 

Enumeration Type Documentation

◆ color

enum color : uint32_t
strong
Enumerator
alice_blue 
antique_white 
aqua 
aquamarine 
azure 
beige 
bisque 
black 
blanched_almond 
blue 
blue_violet 
brown 
burly_wood 
cadet_blue 
chartreuse 
chocolate 
coral 
cornflower_blue 
cornsilk 
crimson 
cyan 
dark_blue 
dark_cyan 
dark_golden_rod 
dark_gray 
dark_green 
dark_khaki 
dark_magenta 
dark_olive_green 
dark_orange 
dark_orchid 
dark_red 
dark_salmon 
dark_sea_green 
dark_slate_blue 
dark_slate_gray 
dark_turquoise 
dark_violet 
deep_pink 
deep_sky_blue 
dim_gray 
dodger_blue 
fire_brick 
floral_white 
forest_green 
fuchsia 
gainsboro 
ghost_white 
gold 
golden_rod 
gray 
green 
green_yellow 
honey_dew 
hot_pink 
indian_red 
indigo 
ivory 
khaki 
lavender 
lavender_blush 
lawn_green 
lemon_chiffon 
light_blue 
light_coral 
light_cyan 
light_golden_rod_yellow 
light_gray 
light_green 
light_pink 
light_salmon 
light_sea_green 
light_sky_blue 
light_slate_gray 
light_steel_blue 
light_yellow 
lime 
lime_green 
linen 
magenta 
maroon 
medium_aquamarine 
medium_blue 
medium_orchid 
medium_purple 
medium_sea_green 
medium_slate_blue 
medium_spring_green 
medium_turquoise 
medium_violet_red 
midnight_blue 
mint_cream 
misty_rose 
moccasin 
navajo_white 
navy 
old_lace 
olive 
olive_drab 
orange 
orange_red 
orchid 
pale_golden_rod 
pale_green 
pale_turquoise 
pale_violet_red 
papaya_whip 
peach_puff 
peru 
pink 
plum 
powder_blue 
purple 
rebecca_purple 
red 
rosy_brown 
royal_blue 
saddle_brown 
salmon 
sandy_brown 
sea_green 
sea_shell 
sienna 
silver 
sky_blue 
slate_blue 
slate_gray 
snow 
spring_green 
steel_blue 
tan 
teal 
thistle 
tomato 
turquoise 
violet 
wheat 
white 
white_smoke 
yellow 
yellow_green 

Definition at line 50 of file color.h.

◆ emphasis

enum emphasis : uint8_t
strong
Enumerator
bold 
italic 
underline 
strikethrough 

Definition at line 213 of file color.h.

◆ terminal_color

enum terminal_color : uint8_t
strong
Enumerator
black 
red 
green 
yellow 
blue 
magenta 
cyan 
white 
bright_black 
bright_red 
bright_green 
bright_yellow 
bright_blue 
bright_magenta 
bright_cyan 
bright_white 

Definition at line 194 of file color.h.

Function Documentation

◆ bg()

Definition at line 381 of file color.h.

Here is the caller graph for this function:

◆ fg()

Definition at line 377 of file color.h.

Here is the caller graph for this function:

◆ operator|()

FMT_CONSTEXPR text_style operator| ( emphasis  lhs,
emphasis  rhs 
)

Definition at line 385 of file color.h.

◆ print() [1/2]

template<typename String , typename... Args>
std::enable_if<internal::is_string<String>::value>::type print ( std::FILE *  f,
const text_style ts,
const String &  format_str,
const Args &...  args 
)

Formats a string and prints it to the specified file stream using ANSI escape sequences to specify text formatting. Example: fmt::print(fmt::emphasis::bold | fg(fmt::color::red), "Elapsed time: {0:.2f} seconds", 1.23);

Definition at line 549 of file color.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ print() [2/2]

template<typename String , typename... Args>
std::enable_if<internal::is_string<String>::value>::type print ( const text_style ts,
const String &  format_str,
const Args &...  args 
)

Formats a string and prints it to stdout using ANSI escape sequences to specify text formatting. Example: fmt::print(fmt::emphasis::bold | fg(fmt::color::red), "Elapsed time: {0:.2f} seconds", 1.23);

Definition at line 567 of file color.h.

Here is the call graph for this function:

◆ vprint()

template<typename S , typename Char = typename internal::char_t<S>::type>
void vprint ( std::FILE *  f,
const text_style ts,
const S &  format,
basic_format_args< typename buffer_context< Char >::type >  args 
)

Definition at line 517 of file color.h.

Here is the call graph for this function:
Here is the caller graph for this function: