diff options
author | Daniel Lange <DLange@git.local> | 2018-04-11 01:26:28 +0200 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2018-04-11 01:52:54 +0200 |
commit | df568a576f7b44ac5a2b9b7222c7f39d9932f626 (patch) | |
tree | b30ce33fd0d49398b52bf9a90b42304a7c32455a /CRT.c | |
parent | 2ee50d030178cede83eb9d0005fbc19f819d30fe (diff) | |
download | debian_htop-df568a576f7b44ac5a2b9b7222c7f39d9932f626.tar.gz debian_htop-df568a576f7b44ac5a2b9b7222c7f39d9932f626.tar.bz2 debian_htop-df568a576f7b44ac5a2b9b7222c7f39d9932f626.zip |
Imported Upstream version 2.2.0
Diffstat (limited to 'CRT.c')
-rw-r--r-- | CRT.c | 32 |
1 files changed, 17 insertions, 15 deletions
@@ -37,6 +37,7 @@ in the source distribution for its full text. #define White COLOR_WHITE #define ColorPairGrayBlack ColorPair(Magenta,Magenta) +#define ColorIndexGrayBlack ColorIndex(Magenta,Magenta) #define KEY_WHEELUP KEY_F(20) #define KEY_WHEELDOWN KEY_F(21) @@ -713,22 +714,23 @@ void CRT_enableDelay() { void CRT_setColors(int colorScheme) { CRT_colorScheme = colorScheme; - if (colorScheme == COLORSCHEME_BLACKNIGHT) { - for (int i = 0; i < 8; i++) - for (int j = 0; j < 8; j++) { - if (ColorIndex(i,j) != ColorIndex(Magenta,Magenta)) { - init_pair(ColorIndex(i,j), i, j); - } - } - init_pair(ColorIndex(Magenta,Magenta), 8, 0); - } else { - for (int i = 0; i < 8; i++) - for (int j = 0; j < 8; j++) { - if (ColorIndex(i,j) != ColorIndex(Magenta,Magenta)) { - init_pair(ColorIndex(i,j), i, (j==0?-1:j)); - } + + for (int i = 0; i < 8; i++) { + for (int j = 0; j < 8; j++) { + if (ColorIndex(i,j) != ColorPairGrayBlack) { + int bg = (colorScheme != COLORSCHEME_BLACKNIGHT) + ? (j==0 ? -1 : j) + : j; + init_pair(ColorIndex(i,j), i, bg); } - init_pair(ColorIndex(Magenta,Magenta), 8, -1); + } } + + int grayBlackFg = COLORS > 8 ? 8 : 0; + int grayBlackBg = (colorScheme != COLORSCHEME_BLACKNIGHT) + ? -1 + : 0; + init_pair(ColorIndexGrayBlack, grayBlackFg, grayBlackBg); + CRT_colors = CRT_colorSchemes[colorScheme]; } |