Thumbnail

rani/cscroll.git

Clone URL: https://git.buni.party/rani/cscroll.git

commit 0efc162620145e27a0ef5137c0e3245488e2b084 Author: rani <clagv.randomgames@gmail.com> Date: Thu Jun 02 16:43:13 2022 +0000 fix one-off error in selecting custom color add check for ability to change colors diff --git a/src/io.c b/src/io.c index 42ad310..dee802c 100644 --- a/src/io.c +++ b/src/io.c @@ -7014 +7015 @@ void terminate_curses(void) {    void set_color(void) {   generate_colors(); + bool cc = can_change_color();     if (color) {   for (int i = CUSTOM_DIR; i <= CUSTOM_ARCHIVE; i++) {   int def = i - CUSTOM_DIR + 1; // default color / index - if (custom_colors[def] == COLOR_DEFAULT) { + if (custom_colors[def] == COLOR_DEFAULT || !cc) {   init_pair(def, default_colors[def], COLOR_BLACK);   } else { - init_color(i, GET_RGB(custom_colors[def - 1])); + init_color(i, GET_RGB(custom_colors[def]));   init_pair(def, i, COLOR_BLACK);   }   }