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:26:28 +0200 |
commit | 097fb9e4a3460fe1b6b3fc645ef97acb44946141 (patch) | |
tree | 58ba6c6459b926f555a539fab1ec01ff4e93d9ce /CRT.c | |
parent | 2f3c2439d8d88cf7c1ecef0bcb2b33f747f3ed06 (diff) | |
parent | c60f4cf3c1d91bd786db8e081699f420f44631f3 (diff) | |
download | debian_htop-097fb9e4a3460fe1b6b3fc645ef97acb44946141.tar.gz debian_htop-097fb9e4a3460fe1b6b3fc645ef97acb44946141.tar.bz2 debian_htop-097fb9e4a3460fe1b6b3fc645ef97acb44946141.zip |
Updated version 2.2.0 from 'upstream/2.2.0'
with Debian dir ed195b175f9cd34e0ba2b22dfecc727ab25e1463
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]; } |