author | František Kučera <franta-hg@frantovo.cz> |
Tue Sep 09 16:22:47 2014 +0200 (2014-09-09) | |
changeset 26 | 16433d4e698d |
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 }