mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-22 01:40:17 -05:00
term: prepare for configurable colors; add color variables to terminal
This commit is contained in:
parent
b18478f9b6
commit
29d855d7c6
5 changed files with 19 additions and 10 deletions
6
render.c
6
render.c
|
|
@ -105,10 +105,10 @@ render_cell(struct terminal *term, struct buffer *buf, const struct cell *cell,
|
|||
|
||||
uint32_t _fg = cell->attrs.foreground >> 31
|
||||
? cell->attrs.foreground
|
||||
: !term->reverse ? term->foreground : term->background;
|
||||
: !term->reverse ? term->colors.fg : term->colors.bg;
|
||||
uint32_t _bg = cell->attrs.background >> 31
|
||||
? cell->attrs.background
|
||||
: !term->reverse ? term->background : term->foreground;
|
||||
: !term->reverse ? term->colors.bg : term->colors.fg;
|
||||
|
||||
/* If *one* is set, we reverse */
|
||||
if (has_cursor ^ cell->attrs.reverse ^ is_selected) {
|
||||
|
|
@ -307,7 +307,7 @@ grid_render(struct terminal *term)
|
|||
int rmargin_width = term->width - rmargin;
|
||||
int bmargin_height = term->height - bmargin;
|
||||
|
||||
uint32_t _bg = !term->reverse ? term->background : term->foreground;
|
||||
uint32_t _bg = !term->reverse ? term->colors.bg : term->colors.fg;
|
||||
struct rgb bg = color_hex_to_rgb(_bg);
|
||||
cairo_set_source_rgb(buf->cairo, bg.r, bg.g, bg.b);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue