about summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ui.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ui.c b/ui.c
index 348dd84..12936ae 100644
--- a/ui.c
+++ b/ui.c
@@ -136,6 +136,7 @@ static short colorPairs;
 static void colorInit(void) {
 	start_color();
 	use_default_colors();
+	if (!COLORS) return;
 	for (short pair = 0; pair < 16; ++pair) {
 		init_pair(1 + pair, pair % COLORS, -1);
 	}
@@ -143,12 +144,14 @@ static void colorInit(void) {
 }
 
 static attr_t colorAttr(short fg) {
+	if (!COLORS) return (fg > 0 ? A_BOLD : A_NORMAL);
 	if (fg != COLOR_BLACK && fg % COLORS == COLOR_BLACK) return A_BOLD;
 	if (COLORS > 8) return A_NORMAL;
 	return (fg / COLORS & 1 ? A_BOLD : A_NORMAL);
 }
 
 static short colorPair(short fg, short bg) {
+	if (!COLORS) return 0;
 	fg %= COLORS;
 	bg %= COLORS;
 	if (bg == -1 && fg < 16) return 1 + fg;
717e62901cf96e049e508b5640b&follow=1'>Declare vasprintf(3) for GNUJune McEnroe 2019-05-20Fix comparison warning in ttpreJune McEnroe 2019-05-20Add AuthorityJune McEnroe 2019-05-19Specify precedence of unary versions of operatorsJune McEnroe 2019-05-18Add compound assignment operators to orderJune McEnroe 2019-05-15Support simple assignment in orderJune McEnroe 2019-05-15Implement sizeof in orderJune McEnroe 2019-05-15Add orderJune McEnroe 2019-05-12Add T suffix in bitJune McEnroe 2019-05-10Highlight yacc and lex files as CJune McEnroe 2019-05-10Use val instead of suboptargJune McEnroe 2019-05-09Add Parable of the SowerJune McEnroe 2019-05-07Add bit without buildJune McEnroe 2019-05-04Fix MANDIR typoJune McEnroe 2019-05-04Move relay to binJune McEnroe