curses: remove unnecessary special handling for dark gray

On terminals with at least 16 colors there should be no need for special
handling dark gray.

The curses code uses COLORS < 16, COLORS <= 16, COLORS > 16, or COLORS >= 16
at several places although I'm not sure if they are correct or which could
possibly be off-by-one errors.

But realistically in this case, we only need to distinguish between 8 color
terminals and terminals supporting more than 8 colors as this will mean the
terminal supports at least 256 colors.
This commit is contained in:
Patric Mueller
2021-06-05 14:38:41 +02:00
parent 6e7f1bc1f0
commit 5c15ca1002
4 changed files with 9 additions and 25 deletions
+1 -1
View File
@@ -1553,7 +1553,7 @@ curses_color_attr(int nh_color, int bg_color)
if (!nh_color) {
#ifdef USE_DARKGRAY
if (iflags.wc2_darkgray) {
if (!can_change_color() || COLORS <= 16)
if (COLORS <= 16)
cattr |= A_BOLD;
} else
#endif