aboutsummaryrefslogtreecommitdiff
path: root/render.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-11-20 15:29:57 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-11-20 15:46:38 +0000
commitd46af6bd7ac7606bf99d63b2453b656a5defb892 (patch)
treea099410b3169c2fd37e85a1588a65f058911f371 /render.c
parentci: one more text-shaping -> grapheme-shaping+run-shaping (diff)
term: track cell color source
Each cell now tracks it’s current color source: * default fg/bg * base16 fg/bg (maps to *both* the regular and bright colors) * base256 fg/bg * RGB Note that we don’t have enough bits to separate the regular from the bright colors. These _shouldn’t_ be the same, so we ought to be fine...
Diffstat (limited to 'render.c')
-rw-r--r--render.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/render.c b/render.c
index 46cc0f75..2710c0a2 100644
--- a/render.c
+++ b/render.c
@@ -494,14 +494,14 @@ render_cell(struct terminal *term, pixman_image_t *pix,
_bg = term->colors.selection_bg;
} else {
/* Use cell specific color, if set, otherwise the default colors (possible reversed) */
- _fg = cell->attrs.have_fg ? cell->attrs.fg : term->reverse ? term->colors.bg : term->colors.fg;
- _bg = cell->attrs.have_bg ? cell->attrs.bg : term->reverse ? term->colors.fg : term->colors.bg;
+ _fg = cell->attrs.fg_src != COLOR_DEFAULT ? cell->attrs.fg : term->reverse ? term->colors.bg : term->colors.fg;
+ _bg = cell->attrs.bg_src != COLOR_DEFAULT ? cell->attrs.bg : term->reverse ? term->colors.fg : term->colors.bg;
if (cell->attrs.reverse ^ is_selected) {
uint32_t swap = _fg;
_fg = _bg;
_bg = swap;
- } else if (!cell->attrs.have_bg)
+ } else if (cell->attrs.bg_src == COLOR_DEFAULT)
alpha = term->colors.alpha;
}