mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-21 05:33:45 -04:00
sixel: VT state’s bg color may now be an index, rather than an actual color value
This commit is contained in:
parent
c2bf2d3650
commit
b218b8cfb0
1 changed files with 18 additions and 3 deletions
21
sixel.c
21
sixel.c
|
|
@ -68,11 +68,26 @@ sixel_init(struct terminal *term, int p1, int p2, int p3)
|
||||||
term->sixel.palette = term->sixel.shared_palette;
|
term->sixel.palette = term->sixel.shared_palette;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t bg = 0;
|
||||||
|
|
||||||
|
switch (term->vt.attrs.bg_src) {
|
||||||
|
case COLOR_RGB:
|
||||||
|
bg = term->vt.attrs.bg;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case COLOR_BASE16:
|
||||||
|
case COLOR_BASE256:
|
||||||
|
bg = term->colors.table[term->vt.attrs.bg];
|
||||||
|
break;
|
||||||
|
|
||||||
|
case COLOR_DEFAULT:
|
||||||
|
bg = term->colors.bg;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
term->sixel.default_bg = term->sixel.transparent_bg
|
term->sixel.default_bg = term->sixel.transparent_bg
|
||||||
? 0x00000000u
|
? 0x00000000u
|
||||||
: 0xffu << 24 | (term->vt.attrs.bg_src != COLOR_DEFAULT
|
: 0xffu << 24 | bg;
|
||||||
? term->vt.attrs.bg
|
|
||||||
: term->colors.bg);
|
|
||||||
|
|
||||||
for (size_t i = 0; i < 1 * 6; i++)
|
for (size_t i = 0; i < 1 * 6; i++)
|
||||||
term->sixel.image.data[i] = term->sixel.default_bg;
|
term->sixel.image.data[i] = term->sixel.default_bg;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue