author | František Kučera <franta-hg@frantovo.cz> |
Mon, 21 Nov 2016 22:48:29 +0100 | |
changeset 43 | b54d76467040 |
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 }