The Sparta Modeling Framework
Loading...
Searching...
No Matches
Colors.hpp File Reference

Color code for SPARTA. More...

#include "sparta/utils/StaticInit.hpp"
#include <vector>
#include "sparta/utils/SpartaException.hpp"

Go to the source code of this file.

Classes

class  sparta::color::ColorScheme
 Accessor methods for obtaining color code strings. More...
 

Namespaces

namespace  sparta
 Macros for handling exponential backoff.
 

Macros

#define SPARTA_UNMANAGED_COLOR_NORMAL   "\033[0;0m"
 
#define SPARTA_UNMANAGED_COLOR_BOLD   "\033[0;1m"
 
#define SPARTA_UNMANAGED_COLOR_RED   "\033[0;31m"
 
#define SPARTA_UNMANAGED_COLOR_GREEN   "\033[0;32m"
 
#define SPARTA_UNMANAGED_COLOR_YELLOW   "\033[0;33m"
 
#define SPARTA_UNMANAGED_COLOR_BLUE   "\033[0;34m"
 
#define SPARTA_UNMANAGED_COLOR_MAGENTA   "\033[0;35m"
 
#define SPARTA_UNMANAGED_COLOR_CYAN   "\033[0;36m"
 
#define SPARTA_UNMANAGED_COLOR_BRIGHT_RED   "\033[1;31m"
 
#define SPARTA_UNMANAGED_COLOR_BRIGHT_GREEN   "\033[1;32m"
 
#define SPARTA_UNMANAGED_COLOR_BRIGHT_YELLOW   "\033[1;33m"
 
#define SPARTA_UNMANAGED_COLOR_BRIGHT_BLUE   "\033[1;34m"
 
#define SPARTA_UNMANAGED_COLOR_BRIGHT_MAGENTA   "\033[1;35m"
 
#define SPARTA_UNMANAGED_COLOR_BRIGHT_CYAN   "\033[1;36m"
 
#define SPARTA_UNMANAGED_COLOR_BG_RED   "\033[0;41m"
 
#define SPARTA_UNMANAGED_COLOR_BG_GREEN   "\033[0;42m"
 
#define SPARTA_UNMANAGED_COLOR_BG_YELLOW   "\033[0;43m"
 
#define SPARTA_UNMANAGED_COLOR_BG_BLUE   "\033[0;44m"
 
#define SPARTA_UNMANAGED_COLOR_BG_MAGENTA   "\033[0;45m"
 
#define SPARTA_UNMANAGED_COLOR_BG_CYAN   "\033[0;46m"
 
#define SPARTA_CURRENT_COLOR_NORMAL   sparta::color::ColorScheme::getDefaultScheme().color(Color::Normal)
 Macros for accessing the colors through the default scheme.
 
#define SPARTA_CURRENT_COLOR_BRIGHT_NORMAL   sparta::color::ColorScheme::getDefaultScheme().color(Color::BrightNormal)
 
#define SPARTA_CURRENT_COLOR_BG_NORMAL   sparta::color::ColorScheme::getDefaultScheme().color(Color::BgNormal)
 
#define SPARTA_CURRENT_COLOR_BOLD   sparta::color::ColorScheme::getDefaultScheme().color(Color::Bold)
 
#define SPARTA_CURRENT_COLOR_BRIGHT_BOLD   sparta::color::ColorScheme::getDefaultScheme().color(Color::BrightBold)
 
#define SPARTA_CURRENT_COLOR_BG_BOLD   sparta::color::ColorScheme::getDefaultScheme().color(Color::BgBold)
 
#define SPARTA_CURRENT_COLOR_RED   sparta::color::ColorScheme::getDefaultScheme().color(Color::Red)
 
#define SPARTA_CURRENT_COLOR_BRIGHT_RED   sparta::color::ColorScheme::getDefaultScheme().color(Color::BrightRed)
 
#define SPARTA_CURRENT_COLOR_BG_RED   sparta::color::ColorScheme::getDefaultScheme().color(Color::BgRed)
 
#define SPARTA_CURRENT_COLOR_GREEN   sparta::color::ColorScheme::getDefaultScheme().color(Color::Green)
 
#define SPARTA_CURRENT_COLOR_BRIGHT_GREEN   sparta::color::ColorScheme::getDefaultScheme().color(Color::BrightGreen)
 
#define SPARTA_CURRENT_COLOR_BG_GREEN   sparta::color::ColorScheme::getDefaultScheme().color(Color::BgGreen)
 
#define SPARTA_CURRENT_COLOR_YELLOW   sparta::color::ColorScheme::getDefaultScheme().color(Color::Yellow)
 
#define SPARTA_CURRENT_COLOR_BRIGHT_YELLOW   sparta::color::ColorScheme::getDefaultScheme().color(Color::BrightYellow)
 
#define SPARTA_CURRENT_COLOR_BG_YELLOW   sparta::color::ColorScheme::getDefaultScheme().color(Color::BgYellow)
 
#define SPARTA_CURRENT_COLOR_BLUE   sparta::color::ColorScheme::getDefaultScheme().color(Color::Blue)
 
#define SPARTA_CURRENT_COLOR_BRIGHT_BLUE   sparta::color::ColorScheme::getDefaultScheme().color(Color::BrightBlue)
 
#define SPARTA_CURRENT_COLOR_BG_BLUE   sparta::color::ColorScheme::getDefaultScheme().color(Color::BgBlue)
 
#define SPARTA_CURRENT_COLOR_MAGENTA   sparta::color::ColorScheme::getDefaultScheme().color(Color::Magenta)
 
#define SPARTA_CURRENT_COLOR_BRIGHT_MAGENTA   sparta::color::ColorScheme::getDefaultScheme().color(Color::BrightMagenta)
 
#define SPARTA_CURRENT_COLOR_BG_MAGENTA   sparta::color::ColorScheme::getDefaultScheme().color(Color::BgMagenta)
 
#define SPARTA_CURRENT_COLOR_CYAN   sparta::color::ColorScheme::getDefaultScheme().color(Color::Cyan)
 
#define SPARTA_CURRENT_COLOR_BRIGHT_CYAN   sparta::color::ColorScheme::getDefaultScheme().color(Color::BrightCyan)
 
#define SPARTA_CURRENT_COLOR_BG_CYAN   sparta::color::ColorScheme::getDefaultScheme().color(Color::BgCyan)
 
#define SPARTA_CMDLINE_COLOR_NORMAL   ""
 
#define SPARTA_CMDLINE_COLOR_ERROR   ""
 
#define SPARTA_CMDLINE_COLOR_WARNING   ""
 
#define SPARTA_CMDLINE_COLOR_GOOD   ""
 

Enumerations

enum class  Color {
  Normal , Bold , Red , Green ,
  Yellow , Blue , Magenta , Cyan ,
  BrightRed , BrightGreen , BrightYellow , BrightBlue ,
  BrightMagenta , BrightCyan , BgRed , BgGreen ,
  BgYellow , BgBlue , BgMagenta , BgCyan
}
 Define enums for accessing the different colors via a ColorScheme. More...
 

Variables

static constexpr char const * ALL_COLORS []
 

Detailed Description

Color code for SPARTA.

Definition in file Colors.hpp.

Macro Definition Documentation

◆ SPARTA_CMDLINE_COLOR_ERROR

#define SPARTA_CMDLINE_COLOR_ERROR   ""

Definition at line 102 of file Colors.hpp.

◆ SPARTA_CMDLINE_COLOR_GOOD

#define SPARTA_CMDLINE_COLOR_GOOD   ""

Definition at line 104 of file Colors.hpp.

◆ SPARTA_CMDLINE_COLOR_NORMAL

#define SPARTA_CMDLINE_COLOR_NORMAL   ""

Definition at line 101 of file Colors.hpp.

◆ SPARTA_CMDLINE_COLOR_WARNING

#define SPARTA_CMDLINE_COLOR_WARNING   ""

Definition at line 103 of file Colors.hpp.

◆ SPARTA_CURRENT_COLOR_BG_BLUE

#define SPARTA_CURRENT_COLOR_BG_BLUE   sparta::color::ColorScheme::getDefaultScheme().color(Color::BgBlue)

Definition at line 57 of file Colors.hpp.

◆ SPARTA_CURRENT_COLOR_BG_BOLD

#define SPARTA_CURRENT_COLOR_BG_BOLD   sparta::color::ColorScheme::getDefaultScheme().color(Color::BgBold)

Definition at line 45 of file Colors.hpp.

◆ SPARTA_CURRENT_COLOR_BG_CYAN

#define SPARTA_CURRENT_COLOR_BG_CYAN   sparta::color::ColorScheme::getDefaultScheme().color(Color::BgCyan)

Definition at line 63 of file Colors.hpp.

◆ SPARTA_CURRENT_COLOR_BG_GREEN

#define SPARTA_CURRENT_COLOR_BG_GREEN   sparta::color::ColorScheme::getDefaultScheme().color(Color::BgGreen)

Definition at line 51 of file Colors.hpp.

◆ SPARTA_CURRENT_COLOR_BG_MAGENTA

#define SPARTA_CURRENT_COLOR_BG_MAGENTA   sparta::color::ColorScheme::getDefaultScheme().color(Color::BgMagenta)

Definition at line 60 of file Colors.hpp.

◆ SPARTA_CURRENT_COLOR_BG_NORMAL

#define SPARTA_CURRENT_COLOR_BG_NORMAL   sparta::color::ColorScheme::getDefaultScheme().color(Color::BgNormal)

Definition at line 42 of file Colors.hpp.

◆ SPARTA_CURRENT_COLOR_BG_RED

#define SPARTA_CURRENT_COLOR_BG_RED   sparta::color::ColorScheme::getDefaultScheme().color(Color::BgRed)

Definition at line 48 of file Colors.hpp.

◆ SPARTA_CURRENT_COLOR_BG_YELLOW

#define SPARTA_CURRENT_COLOR_BG_YELLOW   sparta::color::ColorScheme::getDefaultScheme().color(Color::BgYellow)

Definition at line 54 of file Colors.hpp.

◆ SPARTA_CURRENT_COLOR_BLUE

#define SPARTA_CURRENT_COLOR_BLUE   sparta::color::ColorScheme::getDefaultScheme().color(Color::Blue)

Definition at line 55 of file Colors.hpp.

◆ SPARTA_CURRENT_COLOR_BOLD

#define SPARTA_CURRENT_COLOR_BOLD   sparta::color::ColorScheme::getDefaultScheme().color(Color::Bold)

Definition at line 43 of file Colors.hpp.

◆ SPARTA_CURRENT_COLOR_BRIGHT_BLUE

#define SPARTA_CURRENT_COLOR_BRIGHT_BLUE   sparta::color::ColorScheme::getDefaultScheme().color(Color::BrightBlue)

Definition at line 56 of file Colors.hpp.

◆ SPARTA_CURRENT_COLOR_BRIGHT_BOLD

#define SPARTA_CURRENT_COLOR_BRIGHT_BOLD   sparta::color::ColorScheme::getDefaultScheme().color(Color::BrightBold)

Definition at line 44 of file Colors.hpp.

◆ SPARTA_CURRENT_COLOR_BRIGHT_CYAN

#define SPARTA_CURRENT_COLOR_BRIGHT_CYAN   sparta::color::ColorScheme::getDefaultScheme().color(Color::BrightCyan)

Definition at line 62 of file Colors.hpp.

◆ SPARTA_CURRENT_COLOR_BRIGHT_GREEN

#define SPARTA_CURRENT_COLOR_BRIGHT_GREEN   sparta::color::ColorScheme::getDefaultScheme().color(Color::BrightGreen)

Definition at line 50 of file Colors.hpp.

◆ SPARTA_CURRENT_COLOR_BRIGHT_MAGENTA

#define SPARTA_CURRENT_COLOR_BRIGHT_MAGENTA   sparta::color::ColorScheme::getDefaultScheme().color(Color::BrightMagenta)

Definition at line 59 of file Colors.hpp.

◆ SPARTA_CURRENT_COLOR_BRIGHT_NORMAL

#define SPARTA_CURRENT_COLOR_BRIGHT_NORMAL   sparta::color::ColorScheme::getDefaultScheme().color(Color::BrightNormal)

Definition at line 41 of file Colors.hpp.

◆ SPARTA_CURRENT_COLOR_BRIGHT_RED

#define SPARTA_CURRENT_COLOR_BRIGHT_RED   sparta::color::ColorScheme::getDefaultScheme().color(Color::BrightRed)

Definition at line 47 of file Colors.hpp.

◆ SPARTA_CURRENT_COLOR_BRIGHT_YELLOW

#define SPARTA_CURRENT_COLOR_BRIGHT_YELLOW   sparta::color::ColorScheme::getDefaultScheme().color(Color::BrightYellow)

Definition at line 53 of file Colors.hpp.

◆ SPARTA_CURRENT_COLOR_CYAN

#define SPARTA_CURRENT_COLOR_CYAN   sparta::color::ColorScheme::getDefaultScheme().color(Color::Cyan)

Definition at line 61 of file Colors.hpp.

◆ SPARTA_CURRENT_COLOR_GREEN

#define SPARTA_CURRENT_COLOR_GREEN   sparta::color::ColorScheme::getDefaultScheme().color(Color::Green)

Definition at line 49 of file Colors.hpp.

◆ SPARTA_CURRENT_COLOR_MAGENTA

#define SPARTA_CURRENT_COLOR_MAGENTA   sparta::color::ColorScheme::getDefaultScheme().color(Color::Magenta)

Definition at line 58 of file Colors.hpp.

◆ SPARTA_CURRENT_COLOR_NORMAL

#define SPARTA_CURRENT_COLOR_NORMAL   sparta::color::ColorScheme::getDefaultScheme().color(Color::Normal)

Macros for accessing the colors through the default scheme.

Definition at line 40 of file Colors.hpp.

◆ SPARTA_CURRENT_COLOR_RED

#define SPARTA_CURRENT_COLOR_RED   sparta::color::ColorScheme::getDefaultScheme().color(Color::Red)

Definition at line 46 of file Colors.hpp.

◆ SPARTA_CURRENT_COLOR_YELLOW

#define SPARTA_CURRENT_COLOR_YELLOW   sparta::color::ColorScheme::getDefaultScheme().color(Color::Yellow)

Definition at line 52 of file Colors.hpp.

◆ SPARTA_UNMANAGED_COLOR_BG_BLUE

#define SPARTA_UNMANAGED_COLOR_BG_BLUE   "\033[0;44m"

Definition at line 35 of file Colors.hpp.

◆ SPARTA_UNMANAGED_COLOR_BG_CYAN

#define SPARTA_UNMANAGED_COLOR_BG_CYAN   "\033[0;46m"

Definition at line 37 of file Colors.hpp.

◆ SPARTA_UNMANAGED_COLOR_BG_GREEN

#define SPARTA_UNMANAGED_COLOR_BG_GREEN   "\033[0;42m"

Definition at line 33 of file Colors.hpp.

◆ SPARTA_UNMANAGED_COLOR_BG_MAGENTA

#define SPARTA_UNMANAGED_COLOR_BG_MAGENTA   "\033[0;45m"

Definition at line 36 of file Colors.hpp.

◆ SPARTA_UNMANAGED_COLOR_BG_RED

#define SPARTA_UNMANAGED_COLOR_BG_RED   "\033[0;41m"

Definition at line 32 of file Colors.hpp.

◆ SPARTA_UNMANAGED_COLOR_BG_YELLOW

#define SPARTA_UNMANAGED_COLOR_BG_YELLOW   "\033[0;43m"

Definition at line 34 of file Colors.hpp.

◆ SPARTA_UNMANAGED_COLOR_BLUE

#define SPARTA_UNMANAGED_COLOR_BLUE   "\033[0;34m"

Definition at line 23 of file Colors.hpp.

◆ SPARTA_UNMANAGED_COLOR_BOLD

#define SPARTA_UNMANAGED_COLOR_BOLD   "\033[0;1m"

Definition at line 19 of file Colors.hpp.

◆ SPARTA_UNMANAGED_COLOR_BRIGHT_BLUE

#define SPARTA_UNMANAGED_COLOR_BRIGHT_BLUE   "\033[1;34m"

Definition at line 29 of file Colors.hpp.

◆ SPARTA_UNMANAGED_COLOR_BRIGHT_CYAN

#define SPARTA_UNMANAGED_COLOR_BRIGHT_CYAN   "\033[1;36m"

Definition at line 31 of file Colors.hpp.

◆ SPARTA_UNMANAGED_COLOR_BRIGHT_GREEN

#define SPARTA_UNMANAGED_COLOR_BRIGHT_GREEN   "\033[1;32m"

Definition at line 27 of file Colors.hpp.

◆ SPARTA_UNMANAGED_COLOR_BRIGHT_MAGENTA

#define SPARTA_UNMANAGED_COLOR_BRIGHT_MAGENTA   "\033[1;35m"

Definition at line 30 of file Colors.hpp.

◆ SPARTA_UNMANAGED_COLOR_BRIGHT_RED

#define SPARTA_UNMANAGED_COLOR_BRIGHT_RED   "\033[1;31m"

Definition at line 26 of file Colors.hpp.

◆ SPARTA_UNMANAGED_COLOR_BRIGHT_YELLOW

#define SPARTA_UNMANAGED_COLOR_BRIGHT_YELLOW   "\033[1;33m"

Definition at line 28 of file Colors.hpp.

◆ SPARTA_UNMANAGED_COLOR_CYAN

#define SPARTA_UNMANAGED_COLOR_CYAN   "\033[0;36m"

Definition at line 25 of file Colors.hpp.

◆ SPARTA_UNMANAGED_COLOR_GREEN

#define SPARTA_UNMANAGED_COLOR_GREEN   "\033[0;32m"

Definition at line 21 of file Colors.hpp.

◆ SPARTA_UNMANAGED_COLOR_MAGENTA

#define SPARTA_UNMANAGED_COLOR_MAGENTA   "\033[0;35m"

Definition at line 24 of file Colors.hpp.

◆ SPARTA_UNMANAGED_COLOR_NORMAL

#define SPARTA_UNMANAGED_COLOR_NORMAL   "\033[0;0m"

Define some color code values that are used as the defaults in the global default ColorScheme instance. These should never actually be used manually. You should use the accessor methods of a ColorScheme instance so you get support for easily disabling/enabling the output of colors.

Definition at line 18 of file Colors.hpp.

◆ SPARTA_UNMANAGED_COLOR_RED

#define SPARTA_UNMANAGED_COLOR_RED   "\033[0;31m"

Definition at line 20 of file Colors.hpp.

◆ SPARTA_UNMANAGED_COLOR_YELLOW

#define SPARTA_UNMANAGED_COLOR_YELLOW   "\033[0;33m"

Definition at line 22 of file Colors.hpp.

Enumeration Type Documentation

◆ Color

enum class Color
strong

Define enums for accessing the different colors via a ColorScheme.

Definition at line 91 of file Colors.hpp.

Variable Documentation

◆ ALL_COLORS

constexpr char const* ALL_COLORS[]
staticconstexpr
Initial value:
= {
SPARTA_UNMANAGED_COLOR_BOLD,
SPARTA_UNMANAGED_COLOR_RED,
SPARTA_UNMANAGED_COLOR_GREEN,
SPARTA_UNMANAGED_COLOR_YELLOW,
SPARTA_UNMANAGED_COLOR_BLUE,
SPARTA_UNMANAGED_COLOR_MAGENTA,
SPARTA_UNMANAGED_COLOR_CYAN,
SPARTA_UNMANAGED_COLOR_BRIGHT_RED,
SPARTA_UNMANAGED_COLOR_BRIGHT_GREEN,
SPARTA_UNMANAGED_COLOR_BRIGHT_YELLOW,
SPARTA_UNMANAGED_COLOR_BRIGHT_BLUE,
SPARTA_UNMANAGED_COLOR_BRIGHT_MAGENTA,
SPARTA_UNMANAGED_COLOR_BRIGHT_CYAN,
SPARTA_UNMANAGED_COLOR_BG_RED,
SPARTA_UNMANAGED_COLOR_BG_GREEN,
SPARTA_UNMANAGED_COLOR_BG_YELLOW,
SPARTA_UNMANAGED_COLOR_BG_BLUE,
SPARTA_UNMANAGED_COLOR_BG_MAGENTA,
SPARTA_UNMANAGED_COLOR_BG_CYAN
}
#define SPARTA_UNMANAGED_COLOR_NORMAL
Definition Colors.hpp:18

Definition at line 66 of file Colors.hpp.