Majoranapp
A C++ library for studying MZM in non-interacting systems
Colors.hpp
Go to the documentation of this file.
1 #ifndef INFO_COLORS_HPP
2 #define INFO_COLORS_HPP
3 
4 #include <string>
5 
10 class Color
11 {
12 public:
13  static const std::string green;
14  static const std::string red;
15  static const std::string blue;
16  static const std::string bwhite;
17  static const std::string normal;
18 };
19 
24 {
25 public:
33  static std::string Colorize(std::string text, std::string color)
34  {
35  return color + text + Color::normal;
36  }
37 
44  static std::string StartColor(std::string color)
45  {
46  return color;
47  }
53  static std::string StopColor()
54  {
55  return Color::normal;
56  }
57 };
58 
59 const std::string Color::green{"\033[0;32m"};
60 const std::string Color::red{"\033[0;31m"};
61 const std::string Color::blue{"\033[0;34m"};
62 const std::string Color::bwhite{"\033[1;37m"};
63 const std::string Color::normal{"\033[0m"};
64 
65 
66 #endif
static const std::string green
Definition: Colors.hpp:13
static const std::string bwhite
Definition: Colors.hpp:16
static std::string Colorize(std::string text, std::string color)
Add prefix and suffix for color display in Linux terminal.
Definition: Colors.hpp:33
static std::string StartColor(std::string color)
returns selected color
Definition: Colors.hpp:44
static std::string StopColor()
resets color to default normal
Definition: Colors.hpp:53
static const std::string red
Definition: Colors.hpp:14
Colorizing the text.
Definition: Colors.hpp:23
static const std::string normal
Definition: Colors.hpp:17
static class containing a few color definitions
Definition: Colors.hpp:10
static const std::string blue
Definition: Colors.hpp:15