diff --git a/CMakeLists.txt b/CMakeLists.txt index f8916cd..59b9542 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,13 @@ SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/") set(CURSES_NEED_NCURSES TRUE) set(CURSES_NEED_WIDE TRUE) +#use cmake option -DCOLORS=OFF to disable color output +option(COLORS + "Build with Colors Enabled" ON) +if (COLORS) + add_definitions(-DPRETTY_COLORS) +endif () + include(git_revision) git_describe(GIT_TAG) diff --git a/include/dsd.h b/include/dsd.h index 906b8b3..eedb10a 100644 --- a/include/dsd.h +++ b/include/dsd.h @@ -17,7 +17,8 @@ * PERFORMANCE OF THIS SOFTWARE. */ -//pretty pretty colors +//defined by CMakeLists.txt -- Disable by using cmake -DCOLORS=OFF .. +#ifdef PRETTY_COLORS #define KNRM "\x1B[0m" #define KRED "\x1B[31m" #define KGRN "\x1B[32m" @@ -26,6 +27,16 @@ #define KMAG "\x1B[35m" #define KCYN "\x1B[36m" #define KWHT "\x1B[37m" +#else +#define KNRM "" +#define KRED "" +#define KGRN "" +#define KYEL "" +#define KBLU "" +#define KMAG "" +#define KCYN "" +#define KWHT "" +#endif #include "config.h" #include diff --git a/src/dsd_ncurses.c b/src/dsd_ncurses.c index 6877105..c416dbf 100644 --- a/src/dsd_ncurses.c +++ b/src/dsd_ncurses.c @@ -378,12 +378,23 @@ void ncursesOpen (dsd_opts * opts, dsd_state * state) setlocale(LC_ALL, ""); initscr(); //Initialize NCURSES screen window start_color(); + + #ifdef PRETTY_COLORS init_pair(1, COLOR_YELLOW, COLOR_BLACK); //Yellow/Amber for frame sync/control channel, NV style init_pair(2, COLOR_RED, COLOR_BLACK); //Red for Terminated Calls init_pair(3, COLOR_GREEN, COLOR_BLACK); //Green for Active Calls init_pair(4, COLOR_CYAN, COLOR_BLACK); //Cyan for Site Extra and Patches init_pair(5, COLOR_MAGENTA, COLOR_BLACK); //Magenta for no frame sync/signal init_pair(6, COLOR_WHITE, COLOR_BLACK); //White Card Color Scheme + #else + init_pair(1, COLOR_WHITE, COLOR_BLACK); //White Card Color Scheme + init_pair(2, COLOR_WHITE, COLOR_BLACK); //White Card Color Scheme + init_pair(3, COLOR_WHITE, COLOR_BLACK); //White Card Color Scheme + init_pair(4, COLOR_WHITE, COLOR_BLACK); //White Card Color Scheme + init_pair(5, COLOR_WHITE, COLOR_BLACK); //White Card Color Scheme + init_pair(6, COLOR_WHITE, COLOR_BLACK); //White Card Color Scheme + #endif + noecho(); cbreak();