|
2 | 2 | #include "TextEditorTheme.h" |
3 | 3 | #include <memory> |
4 | 4 |
|
5 | | - |
| 5 | +#define COLOR(X) ((QRgb)0x##X) |
6 | 6 |
|
7 | 7 | TextEditorThemePtr TextEditorTheme::Light() |
8 | 8 | { |
9 | 9 | TextEditorThemePtr t = std::make_shared<TextEditorTheme>(); |
10 | | - t->fg_default = QColor(0, 0, 0); |
11 | | - t->bg_default = QColor(240, 240, 240); |
12 | | - t->fg_line_number = QColor(96, 96, 96); |
13 | | - t->bg_line_number = QColor(208, 208, 208); |
14 | | - t->fg_cursor = QColor(0, 128, 255); |
15 | | - t->bg_current_line = QColor(192, 192, 192); |
16 | | - t->bg_current_line_number = QColor(176, 176, 176); |
17 | | - t->bg_diff_unknown = QColor(208, 208, 208); |
18 | | - t->bg_diff_line_del = QColor(240, 208, 208); |
19 | | - t->bg_diff_line_add = QColor(192, 240, 192); |
20 | | - t->bg_diff_char_del = QColor(240, 160, 160); |
21 | | - t->bg_diff_char_add = QColor(144, 208, 144); |
| 10 | + t->fg_default = COLOR(000000); |
| 11 | + t->bg_default = COLOR(f0f0f0); |
| 12 | + t->fg_line_number = COLOR(606060); |
| 13 | + t->bg_line_number = COLOR(d0d0d0); |
| 14 | + t->fg_cursor = COLOR(0050ff); |
| 15 | + t->bg_current_line = COLOR(c0c0c0); |
| 16 | + t->bg_current_line_number = COLOR(b0b0b0); |
| 17 | + t->bg_diff_unknown = COLOR(d0d0d0); |
| 18 | + t->bg_diff_line_del = COLOR(f0d0d0); |
| 19 | + t->bg_diff_line_add = COLOR(c0f0c0); |
| 20 | + t->bg_diff_char_del = COLOR(f090c0); |
| 21 | + t->bg_diff_char_add = COLOR(80d0c0); |
22 | 22 | return t; |
23 | 23 | } |
24 | 24 |
|
25 | 25 | TextEditorThemePtr TextEditorTheme::Dark() |
26 | 26 | { |
27 | 27 | TextEditorThemePtr t = std::make_shared<TextEditorTheme>(); |
28 | | - t->fg_default = QColor(255, 255, 255); |
29 | | - t->bg_default = QColor(48, 48, 48); // t->bg_default = QColor(0, 0, 64); |
30 | | - t->fg_line_number = QColor(176, 176, 176); |
31 | | - t->bg_line_number = QColor(64, 64, 64); |
32 | | - t->fg_cursor = QColor(0, 128, 255); |
33 | | - t->bg_current_line_number = QColor(96, 96, 96); |
34 | | - t->bg_diff_unknown = QColor(0, 0, 0); |
35 | | - t->bg_diff_line_del = QColor(80, 0, 0); |
36 | | - t->bg_diff_line_add = QColor(0, 64, 0); |
37 | | - t->bg_diff_char_del = QColor(160, 0, 0); |
38 | | - t->bg_diff_char_add = QColor(0, 128, 0); |
| 28 | + t->fg_default = COLOR(ffffff); |
| 29 | + t->bg_default = COLOR(303030); |
| 30 | + t->fg_line_number = COLOR(b0b0b0); |
| 31 | + t->bg_line_number = COLOR(404040); |
| 32 | + t->fg_cursor = COLOR(0050ff); |
| 33 | + t->bg_current_line_number = COLOR(606060); |
| 34 | + t->bg_diff_unknown = COLOR(000000); |
| 35 | + t->bg_diff_line_del = COLOR(500000); |
| 36 | + t->bg_diff_line_add = COLOR(004000); |
| 37 | + t->bg_diff_char_del = COLOR(c03070); |
| 38 | + t->bg_diff_char_add = COLOR(00a040); |
39 | 39 | return t; |
40 | 40 | } |
41 | 41 |
|
0 commit comments