Arduino Libraries
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
color.hpp
Go to the documentation of this file.
1 // Author: Mario S. Könz <mskoenz@gmx.net>
2 // Date: 25.04.2013 18:09:04 EDT
3 // File: color.hpp
4 
5 /* This program is free software. It comes without any warranty, to
6  * the extent permitted by applicable law. You can redistribute it
7  * and/or modify it under the terms of the Do What The Fuck You Want
8  * To Public License, Version 2, as published by Sam Hocevar. See
9  * http://www.wtfpl.net/ or COPYING for more details. */
10 
11 #ifndef __COLOR_HEADER
12 #define __COLOR_HEADER
13 
14 #include <avr/pgmspace.h>
15 
16 namespace ustd {
17  namespace detail {
18  struct dummy_struct {
19  } do_nothing;
20  }//end namespace detail
21 }//end namespace ustd
22 
23 #ifdef COLOR_ON
24 
25 #define CLRSCR F("\033[2J\033[100A")
26 
27 #define BLACK F("\033[0;30m")
28 #define BLACKB F("\033[1;30m")
29 #define RED F("\033[0;31m")
30 #define REDB F("\033[1;31m")
31 #define GREEN F("\033[0;32m")
32 #define GREENB F("\033[1;32m")
33 #define YELLOW F("\033[0;33m")
34 #define YELLOWB F("\033[1;33m")
35 #define BLUE F("\033[0;34m")
36 #define BLUEB F("\033[1;34m")
37 #define MAGENTA F("\033[0;35m")
38 #define MAGENTAB F("\033[1;35m")
39 #define CYAN F("\033[0;36m")
40 #define CYANB F("\033[1;36m")
41 #define WHITE F("\033[0;37m")
42 #define WHITEB F("\033[1;37m")
43 
44 #define BLACKBG F("\033[0;40m")
45 #define REDBG F("\033[0;41m")
46 #define GREENBG F("\033[0;42m")
47 #define YELLOWBG F("\033[0;43m")
48 #define BLUEBG F("\033[0;44m")
49 #define MAGENTABG F("\033[0;45m")
50 #define CYANBG F("\033[0;46m")
51 #define WHITEBG F("\033[0;47m")
52 
53 #define NONE F("\033[0m")
54 
55 #else //NO COLOR
56 
57 #define CLRSCR ustd::detail::do_nothing
58 
59 #define BLACK ustd::detail::do_nothing
60 #define BLACKB ustd::detail::do_nothing
61 #define RED ustd::detail::do_nothing
62 #define REDB ustd::detail::do_nothing
63 #define GREEN ustd::detail::do_nothing
64 #define GREENB ustd::detail::do_nothing
65 #define YELLOW ustd::detail::do_nothing
66 #define YELLOWB ustd::detail::do_nothing
67 #define BLUE ustd::detail::do_nothing
68 #define BLUEB ustd::detail::do_nothing
69 #define MAGENTA ustd::detail::do_nothing
70 #define MAGENTAB ustd::detail::do_nothing
71 #define CYAN ustd::detail::do_nothing
72 #define CYANB ustd::detail::do_nothing
73 #define WHITE ustd::detail::do_nothing
74 #define WHITEB ustd::detail::do_nothing
75 
76 #define BLACKBG ustd::detail::do_nothing
77 #define REDBG ustd::detail::do_nothing
78 #define GREENBG ustd::detail::do_nothing
79 #define YELLOWBG ustd::detail::do_nothing
80 #define BLUEBG ustd::detail::do_nothing
81 #define MAGENTABG ustd::detail::do_nothing
82 #define CYANBG ustd::detail::do_nothing
83 #define WHITEBG ustd::detail::do_nothing
84 
85 #define NONE ustd::detail::do_nothing
86 
87 #endif //NO_COLOR
88 
89 #endif //__COLOR_HEADER