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...
This commit is contained in:
Daniel Eklöf 2021-11-20 16:29:57 +01:00
parent 37b82efa77
commit d46af6bd7a
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
6 changed files with 34 additions and 26 deletions

View file

@ -70,7 +70,7 @@ sixel_init(struct terminal *term, int p1, int p2, int p3)
term->sixel.default_bg = term->sixel.transparent_bg
? 0x00000000u
: 0xffu << 24 | (term->vt.attrs.have_bg
: 0xffu << 24 | (term->vt.attrs.bg_src != COLOR_DEFAULT
? term->vt.attrs.bg
: term->colors.bg);