author | František Kučera <franta-hg@frantovo.cz> |
Tue, 12 May 2020 21:30:46 +0200 | |
changeset 58 | 2f84ed5f3abf |
parent 12 | 7b718fcf981c |
permissions | -rw-r--r-- |
1 #include <barvicky.h>
2 #include <string>
4 using namespace std;
6 string obarvi (string text, int barva) {
7 string zacatek;
8 string konec;
10 switch (barva) {
11 case BARVA_ZELENA :
12 zacatek = string("\033[22;32m");
13 konec = string("\033[0m");
14 break;
15 case BARVA_CERVENA :
16 zacatek = string("\033[22;31m");
17 konec = string("\033[0m");
18 break;
19 dafault:
20 zacatek = ("");
21 konec = ("");
22 }
24 return zacatek + text + konec;
25 }
27 string obarvi (const char * text, int barva) {
28 return obarvi(string(text), barva);
29 }