diff --git a/Objects/Utils/Colors.cpp b/Objects/Utils/Colors.cpp new file mode 100644 index 0000000..40f871c --- /dev/null +++ b/Objects/Utils/Colors.cpp @@ -0,0 +1,32 @@ +#include "Colors.h" + +Colors::Colors(){ + this->returnDefault(); +} + +void Colors::returnDefault(){ + this->unkn = red; + this->unknMark = magenta; + this->kn = green; + this->knMark = cyan; + this->occup = yellow; + this->occupMark = blue; + this->reset = resetColor; + this->invert = invertText; + this->cross = crossText; +} + +void Colors::changeColor(int index, std::string color){ + switch(index){ + case 0: this->reset = color; break; + case 1: this->unkn = color; break; + case 2: this->unknMark = color; break; + case 3: this->kn = color; break; + case 4: this->knMark = color; break; + case 5: this->occup = color; break; + case 6: this->occupMark = color; break; + case 7: this->invert = color; break; + case 8: this->cross = color; break; + default: break; + } +} diff --git a/Objects/Utils/Colors.h b/Objects/Utils/Colors.h new file mode 100644 index 0000000..adfc2ce --- /dev/null +++ b/Objects/Utils/Colors.h @@ -0,0 +1,34 @@ +#ifndef COLORS_H +#define COLORS_H +#include + + +static const std::string red ("\033[0;31;1m"); +static const std::string green ("\033[0;32;1m"); +static const std::string yellow ("\033[0;33;1m"); +static const std::string blue ("\033[0;34;1m"); +static const std::string magenta ("\033[0;35;1m"); +static const std::string cyan ("\033[0;36;1m"); +static const std::string white ("\033[0;37;1m"); +static const std::string resetColor ("\033[0m"); +static const std::string invertText("\033[7m"); +static const std::string crossText ("\033[9m"); + +class Colors{ + public: + Colors(); + std::string unkn; + std::string unknMark; + std::string kn; + std::string knMark; + std::string occup; + std::string occupMark; + std::string reset; + std::string invert; + std::string cross; + void returnDefault(); + void changeColor(int index, std::string color); + +}; + +#endif \ No newline at end of file