summaryrefslogtreecommitdiff
path: root/src/dged/buffer_view.c
diff options
context:
space:
mode:
authorAlbert Cervin <albert@acervin.com>2024-05-06 22:44:40 +0200
committerAlbert Cervin <albert@acervin.com>2024-05-06 22:44:40 +0200
commit292b2786a513f4a058889fc088598cb5acf1bcc5 (patch)
treeda0619b8cd98791a42393a333486b6638fabc4b7 /src/dged/buffer_view.c
parentad0cd5c036f0080ee8d97db2e67b8d54186d1e33 (diff)
downloaddged-292b2786a513f4a058889fc088598cb5acf1bcc5.tar.gz
dged-292b2786a513f4a058889fc088598cb5acf1bcc5.tar.xz
dged-292b2786a513f4a058889fc088598cb5acf1bcc5.zip
Add inverted colors mode
Also use color constants in some more places.
Diffstat (limited to 'src/dged/buffer_view.c')
-rw-r--r--src/dged/buffer_view.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/dged/buffer_view.c b/src/dged/buffer_view.c
index 0ba269c..6d77822 100644
--- a/src/dged/buffer_view.c
+++ b/src/dged/buffer_view.c
@@ -313,8 +313,9 @@ static uint32_t render_line_numbers(struct buffer_view *view,
uint32_t relline = 0;
for (; relline < height && line < nlines_buf; ++line, ++relline) {
- command_list_set_index_color_bg(commands, 8);
- command_list_set_index_color_fg(commands, line == view->dot.line ? 15 : 7);
+ command_list_set_index_color_bg(commands, Color_BrightBlack);
+ command_list_set_index_color_fg(
+ commands, line == view->dot.line ? Color_BrightWhite : Color_White);
uint32_t chars = snprintf(buf, 16, "%*d", longest_nchars + 1, line + 1);
command_list_draw_text_copy(commands, 0, relline, (uint8_t *)buf, chars);
command_list_reset_color(commands);
@@ -322,8 +323,8 @@ static uint32_t render_line_numbers(struct buffer_view *view,
}
for (; relline < height; ++relline) {
- command_list_set_index_color_bg(commands, 8);
- command_list_set_index_color_fg(commands, 7);
+ command_list_set_index_color_bg(commands, Color_BrightBlack);
+ command_list_set_index_color_fg(commands, Color_White);
command_list_draw_repeated(commands, 0, relline, ' ', longest_nchars + 1);
command_list_reset_color(commands);
command_list_draw_repeated(commands, longest_nchars + 1, relline, ' ', 1);
@@ -363,7 +364,8 @@ static void render_modeline(struct modeline *modeline, struct buffer_view *view,
modeline->buffer[len] = '\0';
}
- command_list_set_index_color_bg(commands, 8);
+ command_list_set_index_color_bg(commands, Color_BrightBlack);
+ command_list_set_index_color_fg(commands, Color_White);
command_list_draw_text(commands, 0, height - 1, modeline->buffer,
strlen((char *)modeline->buffer));
command_list_reset_color(commands);