From d94ac247853feda2d5be2d6ab3d7629726fdd092 Mon Sep 17 00:00:00 2001 From: ache Date: Fri, 13 Sep 2019 00:58:58 +0200 Subject: Use default color background --- main.c | 8 ++++++-- messageWind.c | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/main.c b/main.c index 2d1ec05..94edda9 100644 --- a/main.c +++ b/main.c @@ -159,8 +159,12 @@ int main(int argc, char* argv[]){ int c; int comp = 0; + int defaultBG = -1; + initscr(); if (has_colors()) { + if(use_default_colors() == ERR) + defaultBG = COLOR_BLACK; CHECK(start_color); } @@ -184,8 +188,8 @@ int main(int argc, char* argv[]){ init_readline(); const int nbColor = sizeof colors / sizeof *colors; - for(int i = 2 ; i < nbColor ; i++) { - init_pair( i, colors[i], COLOR_BLACK); + for(int i = 1 ; i < nbColor ; i++) { + init_pair( i, colors[i], defaultBG); } // inotify stuff diff --git a/messageWind.c b/messageWind.c index 15efcbd..b8ee9c8 100644 --- a/messageWind.c +++ b/messageWind.c @@ -66,8 +66,8 @@ int show1SMS(sms* S, int y_base, int* hasFinish) { *hasFinish = 1; - int nbColors = 7 - 1; - attrset( COLOR_PAIR( (rand() % nbColors) + 2) | A_BOLD); + int nbColors = 8 - 1; + attrset( COLOR_PAIR( (rand() % nbColors) + 1) | A_BOLD); while( S->text[iS] ) { x = 0; while( x < w_WMessageSMS-1 && S->text[iS]) { -- cgit v1.2.3