From a82d55717ac255b192ace719f1a5bd6345ece2fd Mon Sep 17 00:00:00 2001 From: Brian Barto Date: Thu, 14 Apr 2016 16:25:16 -0400 Subject: [PATCH] Integrated ncurses color functions to replace my raw escape characters I used for color. modified: src/nms.h --- src/nms.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/nms.h b/src/nms.h index 76c9edc..c5df664 100644 --- a/src/nms.h +++ b/src/nms.h @@ -12,10 +12,6 @@ #define NEWLINE 10 #define TAB 9 -#define KNRM "\x1B[0m" -#define KMAG "\x1B[35m" -#define KCYN "\x1B[36m" - struct winpos { char source; char mask; @@ -176,11 +172,17 @@ void nmsexec(void) { list_pointer->mask = getMaskChar(); } else { list_pointer->mask = list_pointer->source; - //printf(KCYN); + attron(A_BOLD); + if (has_colors()) + attron(COLOR_PAIR(1)); } mvaddch(list_pointer->row, list_pointer->col, list_pointer->mask); refresh(); list_pointer = list_pointer->next; + + attroff(A_BOLD); + if (has_colors()) + attroff(COLOR_PAIR(1)); } usleep(ms * 1000); }