- switch(color_theme) {
- default:
- case 0:
- init_pair(1, COLOR_WHITE, COLOR_GREEN);
- init_pair(2, COLOR_BLACK, COLOR_YELLOW);
- break;
- case 1:
- init_pair(1, COLOR_WHITE, COLOR_BLACK);
- init_pair(2, COLOR_BLACK, COLOR_YELLOW);
- break;
- case 2:
- init_pair(1, COLOR_BLACK, COLOR_GREEN);
- init_pair(2, COLOR_BLACK, COLOR_YELLOW);
- break;
- case 3:
- init_pair(1, COLOR_BLACK, COLOR_RED);
- init_pair(2, COLOR_BLACK, COLOR_YELLOW);
- break;
- case 4:
- init_pair(1, COLOR_WHITE, COLOR_BLACK);
- init_pair(2, COLOR_BLACK, COLOR_BLUE);
- break;
- case 5:
- init_pair(1, COLOR_BLACK, COLOR_MAGENTA);
- init_pair(2, COLOR_BLACK, COLOR_CYAN);
- break;
+ if(color_fg_modeline < 0 || color_fg_modeline >= COLORS ||
+ color_bg_modeline < 0 || color_bg_modeline >= COLORS ||
+ color_fg_highlight < 0 || color_bg_highlight >= COLORS ||
+ color_bg_highlight < 0 || color_bg_highlight >= COLORS) {
+ echo();
+ curs_set(1);
+ endwin();
+ cerr << "Color numbers have to be between 0 and " << COLORS - 1 << "." << endl;
+ exit(1);