Goby3  3.1.5a
2024.05.23
goby::util::tcolor Namespace Reference

Contains functions for adding color to Terminal window streams. More...

Functions

std::ostream & add_escape_code (std::ostream &os, const std::string &esc_code)
 
std::ostream & red (std::ostream &os)
 All text following this manipulator is red. (e.g. std::cout << red << "text";) More...
 
std::ostream & lt_red (std::ostream &os)
 All text following this manipulator is light red (e.g. std::cout << lt_red << "text";) More...
 
std::ostream & green (std::ostream &os)
 All text following this manipulator is green (e.g. std::cout << green << "text";) More...
 
std::ostream & lt_green (std::ostream &os)
 All text following this manipulator is light green (e.g. std::cout << lt_green << "text";) More...
 
std::ostream & yellow (std::ostream &os)
 All text following this manipulator is yellow (e.g. std::cout << yellow << "text";) More...
 
std::ostream & lt_yellow (std::ostream &os)
 All text following this manipulator is light yellow (e.g. std::cout << lt_yellow << "text";) More...
 
std::ostream & blue (std::ostream &os)
 All text following this manipulator is blue (e.g. std::cout << blue << "text";) More...
 
std::ostream & lt_blue (std::ostream &os)
 All text following this manipulator is light blue (e.g. std::cout << lt_blue << "text";) More...
 
std::ostream & magenta (std::ostream &os)
 All text following this manipulator is magenta (e.g. std::cout << magenta << "text";) More...
 
std::ostream & lt_magenta (std::ostream &os)
 All text following this manipulator is light magenta (e.g. std::cout << lt_magenta << "text";) More...
 
std::ostream & cyan (std::ostream &os)
 All text following this manipulator is cyan (e.g. std::cout << cyan << "text";) More...
 
std::ostream & lt_cyan (std::ostream &os)
 All text following this manipulator is light cyan (e.g. std::cout << lt_cyan << "text";) More...
 
std::ostream & white (std::ostream &os)
 All text following this manipulator is white (e.g. std::cout << white << "text";) More...
 
std::ostream & lt_white (std::ostream &os)
 All text following this manipulator is bright white (e.g. std::cout << lt_white << "text";) More...
 
std::ostream & nocolor (std::ostream &os)
 All text following this manipulator is uncolored (e.g. std::cout << green << "green" << nocolor << "uncolored";) More...
 

Detailed Description

Contains functions for adding color to Terminal window streams.

Function Documentation

◆ add_escape_code()

std::ostream& goby::util::tcolor::add_escape_code ( std::ostream &  os,
const std::string &  esc_code 
)

Append the given escape code to the stream os

Parameters
osostream to append to
esc_codeescape code to append (e.g. "\33[31m")

◆ blue()

std::ostream& goby::util::tcolor::blue ( std::ostream &  os)
inline

All text following this manipulator is blue (e.g. std::cout << blue << "text";)

Definition at line 80 of file term_color.h.

◆ cyan()

std::ostream& goby::util::tcolor::cyan ( std::ostream &  os)
inline

All text following this manipulator is cyan (e.g. std::cout << cyan << "text";)

Definition at line 92 of file term_color.h.

◆ green()

std::ostream& goby::util::tcolor::green ( std::ostream &  os)
inline

All text following this manipulator is green (e.g. std::cout << green << "text";)

Definition at line 68 of file term_color.h.

◆ lt_blue()

std::ostream& goby::util::tcolor::lt_blue ( std::ostream &  os)
inline

All text following this manipulator is light blue (e.g. std::cout << lt_blue << "text";)

Definition at line 83 of file term_color.h.

◆ lt_cyan()

std::ostream& goby::util::tcolor::lt_cyan ( std::ostream &  os)
inline

All text following this manipulator is light cyan (e.g. std::cout << lt_cyan << "text";)

Definition at line 95 of file term_color.h.

◆ lt_green()

std::ostream& goby::util::tcolor::lt_green ( std::ostream &  os)
inline

All text following this manipulator is light green (e.g. std::cout << lt_green << "text";)

Definition at line 71 of file term_color.h.

◆ lt_magenta()

std::ostream& goby::util::tcolor::lt_magenta ( std::ostream &  os)
inline

All text following this manipulator is light magenta (e.g. std::cout << lt_magenta << "text";)

Definition at line 89 of file term_color.h.

◆ lt_red()

std::ostream& goby::util::tcolor::lt_red ( std::ostream &  os)
inline

All text following this manipulator is light red (e.g. std::cout << lt_red << "text";)

Definition at line 65 of file term_color.h.

◆ lt_white()

std::ostream& goby::util::tcolor::lt_white ( std::ostream &  os)
inline

All text following this manipulator is bright white (e.g. std::cout << lt_white << "text";)

Definition at line 101 of file term_color.h.

◆ lt_yellow()

std::ostream& goby::util::tcolor::lt_yellow ( std::ostream &  os)
inline

All text following this manipulator is light yellow (e.g. std::cout << lt_yellow << "text";)

Definition at line 77 of file term_color.h.

◆ magenta()

std::ostream& goby::util::tcolor::magenta ( std::ostream &  os)
inline

All text following this manipulator is magenta (e.g. std::cout << magenta << "text";)

Definition at line 86 of file term_color.h.

◆ nocolor()

std::ostream& goby::util::tcolor::nocolor ( std::ostream &  os)
inline

All text following this manipulator is uncolored (e.g. std::cout << green << "green" << nocolor << "uncolored";)

Definition at line 104 of file term_color.h.

◆ red()

std::ostream& goby::util::tcolor::red ( std::ostream &  os)
inline

All text following this manipulator is red. (e.g. std::cout << red << "text";)

Definition at line 62 of file term_color.h.

◆ white()

std::ostream& goby::util::tcolor::white ( std::ostream &  os)
inline

All text following this manipulator is white (e.g. std::cout << white << "text";)

Definition at line 98 of file term_color.h.

◆ yellow()

std::ostream& goby::util::tcolor::yellow ( std::ostream &  os)
inline

All text following this manipulator is yellow (e.g. std::cout << yellow << "text";)

Definition at line 74 of file term_color.h.