|
61 | 61 | #endif |
62 | 62 |
|
63 | 63 | // Define standard curses color constants for better readability |
64 | | -#define C_BLACK 0 |
65 | | -#define C_RED 1 |
66 | | -#define C_GREEN 2 |
67 | | -#define C_YELLOW 3 |
68 | | -#define C_BLUE 4 |
| 64 | +#define C_BLACK 0 |
| 65 | +#define C_RED 1 |
| 66 | +#define C_GREEN 2 |
| 67 | +#define C_YELLOW 3 |
| 68 | +#define C_BLUE 4 |
69 | 69 | #define C_MAGENTA 5 |
70 | | -#define C_CYAN 6 |
71 | | -#define C_WHITE 7 |
| 70 | +#define C_CYAN 6 |
| 71 | +#define C_WHITE 7 |
72 | 72 |
|
73 | 73 | // Define color element indices |
74 | 74 | enum ColorElement { |
@@ -157,36 +157,36 @@ static void version(void) { |
157 | 157 | static void set_color_scheme(const char *scheme_name) { |
158 | 158 | if (strcmp(scheme_name, "dark1") == 0) { |
159 | 159 | // Blue-cyan-yellow scheme for dark terminals |
160 | | - colors[LINE_COLOR] = C_BLUE; // Blue for plot line |
161 | | - colors[AXES_COLOR] = C_CYAN; // Cyan for axes |
162 | | - colors[TEXT_COLOR] = C_WHITE; // White for text |
163 | | - colors[TITLE_COLOR] = C_YELLOW; // Yellow for title |
164 | | - colors[MAX_ERROR_COLOR] = C_RED; // Red for max error |
165 | | - colors[MIN_ERROR_COLOR] = C_GREEN; // Green for min error |
| 160 | + colors[LINE_COLOR] = C_BLUE; // Blue for plot line |
| 161 | + colors[AXES_COLOR] = C_CYAN; // Cyan for axes |
| 162 | + colors[TEXT_COLOR] = C_WHITE; // White for text |
| 163 | + colors[TITLE_COLOR] = C_YELLOW; // Yellow for title |
| 164 | + colors[MAX_ERROR_COLOR] = C_RED; // Red for max error |
| 165 | + colors[MIN_ERROR_COLOR] = C_GREEN; // Green for min error |
166 | 166 | } else if (strcmp(scheme_name, "dark2") == 0) { |
167 | 167 | // Purple-yellow-green scheme for dark terminals |
168 | | - colors[LINE_COLOR] = C_MAGENTA; // Magenta for plot line |
169 | | - colors[AXES_COLOR] = C_YELLOW; // Yellow for axes |
170 | | - colors[TEXT_COLOR] = C_CYAN; // Cyan for text |
171 | | - colors[TITLE_COLOR] = C_GREEN; // Green for title |
172 | | - colors[MAX_ERROR_COLOR] = C_RED; // Red for max error |
173 | | - colors[MIN_ERROR_COLOR] = C_BLUE; // Blue for min error |
| 168 | + colors[LINE_COLOR] = C_MAGENTA; // Magenta for plot line |
| 169 | + colors[AXES_COLOR] = C_YELLOW; // Yellow for axes |
| 170 | + colors[TEXT_COLOR] = C_CYAN; // Cyan for text |
| 171 | + colors[TITLE_COLOR] = C_GREEN; // Green for title |
| 172 | + colors[MAX_ERROR_COLOR] = C_RED; // Red for max error |
| 173 | + colors[MIN_ERROR_COLOR] = C_BLUE; // Blue for min error |
174 | 174 | } else if (strcmp(scheme_name, "light1") == 0) { |
175 | 175 | // Green-blue-red scheme for light terminals |
176 | | - colors[LINE_COLOR] = C_GREEN; // Green for plot line |
177 | | - colors[AXES_COLOR] = C_BLUE; // Blue for axes |
178 | | - colors[TEXT_COLOR] = C_BLACK; // Black for text |
179 | | - colors[TITLE_COLOR] = C_RED; // Red for title |
180 | | - colors[MAX_ERROR_COLOR] = C_RED; // Red for max error |
181 | | - colors[MIN_ERROR_COLOR] = C_MAGENTA; // Magenta for min error |
| 176 | + colors[LINE_COLOR] = C_GREEN; // Green for plot line |
| 177 | + colors[AXES_COLOR] = C_BLUE; // Blue for axes |
| 178 | + colors[TEXT_COLOR] = C_BLACK; // Black for text |
| 179 | + colors[TITLE_COLOR] = C_RED; // Red for title |
| 180 | + colors[MAX_ERROR_COLOR] = C_RED; // Red for max error |
| 181 | + colors[MIN_ERROR_COLOR] = C_MAGENTA; // Magenta for min error |
182 | 182 | } else if (strcmp(scheme_name, "light2") == 0) { |
183 | 183 | // Blue-green-yellow scheme for light terminals |
184 | | - colors[LINE_COLOR] = C_BLUE; // Blue for plot line |
185 | | - colors[AXES_COLOR] = C_GREEN; // Green for axes |
186 | | - colors[TEXT_COLOR] = C_BLACK; // Black for text |
187 | | - colors[TITLE_COLOR] = C_YELLOW; // Yellow for title |
188 | | - colors[MAX_ERROR_COLOR] = C_RED; // Red for max error |
189 | | - colors[MIN_ERROR_COLOR] = C_MAGENTA; // Magenta for min error |
| 184 | + colors[LINE_COLOR] = C_BLUE; // Blue for plot line |
| 185 | + colors[AXES_COLOR] = C_GREEN; // Green for axes |
| 186 | + colors[TEXT_COLOR] = C_BLACK; // Black for text |
| 187 | + colors[TITLE_COLOR] = C_YELLOW; // Yellow for title |
| 188 | + colors[MAX_ERROR_COLOR] = C_RED; // Red for max error |
| 189 | + colors[MIN_ERROR_COLOR] = C_MAGENTA; // Magenta for min error |
190 | 190 | } |
191 | 191 | } |
192 | 192 |
|
@@ -321,16 +321,17 @@ static void draw_line(int x, int ph, int l1, int l2, cchar_t *c1, cchar_t *c2, |
321 | 321 | mvvline_set(ph + 1 - l2, x, &c2r, l2); |
322 | 322 | } |
323 | 323 |
|
324 | | - // Reset all color attributes (COLOR_PAIR indexes are LINE_COLOR+1 through MIN_ERROR_COLOR+1) |
325 | | - const attr_t color_mask = COLOR_PAIR(LINE_COLOR + 1) | |
| 324 | + // Reset all color attributes (COLOR_PAIR indexes are LINE_COLOR+1 through |
| 325 | + // MIN_ERROR_COLOR+1) |
| 326 | + const attr_t color_mask = COLOR_PAIR(LINE_COLOR + 1) | |
326 | 327 | COLOR_PAIR(MAX_ERROR_COLOR + 1) | |
327 | 328 | COLOR_PAIR(MIN_ERROR_COLOR + 1); |
328 | | - |
| 329 | + |
329 | 330 | c1->attr &= ~color_mask; |
330 | 331 | c2->attr &= ~color_mask; |
331 | 332 | c1r.attr &= ~color_mask; |
332 | 333 | c2r.attr &= ~color_mask; |
333 | | - |
| 334 | + |
334 | 335 | if (colors[LINE_COLOR] != -1) { |
335 | 336 | space.attr &= ~COLOR_PAIR(LINE_COLOR + 1); |
336 | 337 | } |
@@ -803,10 +804,8 @@ int main(int argc, char *argv[]) { |
803 | 804 | break; |
804 | 805 | case 'C': { |
805 | 806 | // Check if it's a predefined color scheme |
806 | | - if (strcmp(optarg, "dark1") == 0 || |
807 | | - strcmp(optarg, "dark2") == 0 || |
808 | | - strcmp(optarg, "light1") == 0 || |
809 | | - strcmp(optarg, "light2") == 0) { |
| 807 | + if (strcmp(optarg, "dark1") == 0 || strcmp(optarg, "dark2") == 0 || |
| 808 | + strcmp(optarg, "light1") == 0 || strcmp(optarg, "light2") == 0) { |
810 | 809 | set_color_scheme(optarg); |
811 | 810 | } else { |
812 | 811 | // Process comma-separated color values |
|
0 commit comments