My Project  + 80db3
Classes | Enumerations | Functions | Variables
color Namespace Reference

Classes

struct  shell_command
 Object that can be written to the console to change the output color. More...
 

Enumerations

enum  is_enabled { enable, disable, automatic }
 

Functions

void init (is_enabled color=automatic, is_enabled progress=automatic)
 Initilize console output functions. More...
 
std::ostream & operator<< (std::ostream &os, shell_command command)
 

Variables

shell_command black = { "\x1b[1;30m" }
 
shell_command red = { "\x1b[1;31m" }
 
shell_command green = { "\x1b[1;32m" }
 
shell_command yellow = { "\x1b[1;33m" }
 
shell_command blue = { "\x1b[1;34m" }
 
shell_command magenta = { "\x1b[1;35m" }
 
shell_command cyan = { "\x1b[1;36m" }
 
shell_command white = { "\x1b[1;37m" }
 
shell_command dim_black = { "\x1b[;30m" }
 
shell_command dim_red = { "\x1b[;31m" }
 
shell_command dim_green = { "\x1b[;32m" }
 
shell_command dim_yellow = { "\x1b[;33m" }
 
shell_command dim_blue = { "\x1b[;34m" }
 
shell_command dim_magenta = { "\x1b[;35m" }
 
shell_command dim_cyan = { "\x1b[;36m" }
 
shell_command dim_white = { "\x1b[;37m" }
 
shell_command reset = { "\x1b[m" }
 Reset the output color to the original value. More...
 
shell_command current = reset
 The last set output color. More...
 

Enumeration Type Documentation

◆ is_enabled

Enumerator
enable 
disable 
automatic 

Definition at line 75 of file console.hpp.

Function Documentation

◆ init()

void color::init ( is_enabled  color = automatic,
is_enabled  progress = automatic 
)

Initilize console output functions.

Parameters
colorEnable or disable color output.
progressEnable or disable progress bar output.

Definition at line 90 of file console.cpp.

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

◆ operator<<()

std::ostream& color::operator<< ( std::ostream &  os,
shell_command  command 
)
inline

Definition at line 70 of file console.hpp.

Variable Documentation

◆ black

shell_command color::black = { "\x1b[1;30m" }

Definition at line 68 of file console.cpp.

◆ red

shell_command color::red = { "\x1b[1;31m" }

Definition at line 69 of file console.cpp.

◆ green

shell_command color::green = { "\x1b[1;32m" }

Definition at line 70 of file console.cpp.

◆ yellow

shell_command color::yellow = { "\x1b[1;33m" }

Definition at line 71 of file console.cpp.

◆ blue

shell_command color::blue = { "\x1b[1;34m" }

Definition at line 72 of file console.cpp.

◆ magenta

shell_command color::magenta = { "\x1b[1;35m" }

Definition at line 73 of file console.cpp.

◆ cyan

shell_command color::cyan = { "\x1b[1;36m" }

Definition at line 74 of file console.cpp.

◆ white

shell_command color::white = { "\x1b[1;37m" }

Definition at line 75 of file console.cpp.

◆ dim_black

shell_command color::dim_black = { "\x1b[;30m" }

Definition at line 77 of file console.cpp.

◆ dim_red

shell_command color::dim_red = { "\x1b[;31m" }

Definition at line 78 of file console.cpp.

◆ dim_green

shell_command color::dim_green = { "\x1b[;32m" }

Definition at line 79 of file console.cpp.

◆ dim_yellow

shell_command color::dim_yellow = { "\x1b[;33m" }

Definition at line 80 of file console.cpp.

◆ dim_blue

shell_command color::dim_blue = { "\x1b[;34m" }

Definition at line 81 of file console.cpp.

◆ dim_magenta

shell_command color::dim_magenta = { "\x1b[;35m" }

Definition at line 82 of file console.cpp.

◆ dim_cyan

shell_command color::dim_cyan = { "\x1b[;36m" }

Definition at line 83 of file console.cpp.

◆ dim_white

shell_command color::dim_white = { "\x1b[;37m" }

Definition at line 84 of file console.cpp.

◆ reset

shell_command color::reset = { "\x1b[m" }

Reset the output color to the original value.

Definition at line 86 of file console.cpp.

◆ current

shell_command color::current = reset

The last set output color.

Definition at line 88 of file console.cpp.