diff --git a/direwolf.c b/direwolf.c index 604fe88..b696baa 100644 --- a/direwolf.c +++ b/direwolf.c @@ -251,6 +251,7 @@ int main (int argc, char *argv[]) */ t_opt = 1; /* 1 = normal, 0 = no text colors. */ + /* 2, 3, ... alternate escape sequences for different terminals. */ for (j=1; j MAX_T) { + int t; + for (t = 0; t <= MAX_T; t++) { + text_color_init (t); + printf ("-t %d", t); + if (t) printf (" [white background] "); + printf ("\n"); + printf ("%sBlack ", t_black[t]); + printf ("%sRed ", t_red[t]); + printf ("%sGreen ", t_green[t]); + printf ("%sDark-Green ", t_dark_green[t]); + printf ("%sYellow ", t_yellow[t]); + printf ("%sBlue ", t_blue[t]); + printf ("%sMagenta ", t_magenta[t]); + printf ("%sCyan \n", t_cyan[t]); + } + exit (EXIT_SUCCESS); + } + + g_enable_color = enable_color; + + if (g_enable_color != 0) { + int t = g_enable_color; + + if (t < 0) t = 0; + if (t > MAX_T) t = MAX_T; + + printf ("%s", t_background_white[t]); printf ("%s", clear_eos); - printf ("%s", black); + printf ("%s", t_black[t]); } #endif } @@ -268,7 +250,10 @@ void text_color_set ( enum dw_color_e c ) break; case DW_COLOR_REC: - attr = FOREGROUND_GREEN | FOREGROUND_INTENSITY | BACKGROUND_WHITE; + // Release 1.6. Dark green, same as for debug. + // Bright green is too hard to see with white background, + // attr = FOREGROUND_GREEN | FOREGROUND_INTENSITY | BACKGROUND_WHITE; + attr = FOREGROUND_GREEN | BACKGROUND_WHITE; break; case DW_COLOR_DECODED: @@ -300,31 +285,39 @@ void text_color_set ( enum dw_color_e c ) return; } + int t = g_enable_color; + + if (t < 0) t = 0; + if (t > MAX_T) t = MAX_T; + switch (c) { default: case DW_COLOR_INFO: - printf ("%s", black); + printf ("%s", t_black[t]); break; case DW_COLOR_ERROR: - printf ("%s", red); + printf ("%s", t_red[t]); break; case DW_COLOR_REC: - printf ("%s", green); + // Bright green is very difficult to read against a while background. + // Let's use dark green instead. release 1.6. + //printf ("%s", t_green[t]); + printf ("%s", t_dark_green[t]); break; case DW_COLOR_DECODED: - printf ("%s", blue); + printf ("%s", t_blue[t]); break; case DW_COLOR_XMIT: - printf ("%s", magenta); + printf ("%s", t_magenta[t]); break; case DW_COLOR_DEBUG: - printf ("%s", dark_green); + printf ("%s", t_dark_green[t]); break; } }