diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2021-12-25 20:22:40 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-12-26 11:37:48 +0000 |
| commit | b218b8cfb0938b44cf75209d342c20240d9f8ef3 (patch) | |
| tree | 64bf598076f70a152c175da88a848de9f30e0afb | |
| parent | csi: store color index, not actual color, in cell’s fg/bg attributes (diff) | |
sixel: VT state’s bg color may now be an index, rather than an actual color value
| -rw-r--r-- | sixel.c | 21 |
1 files changed, 18 insertions, 3 deletions
@@ -68,11 +68,26 @@ sixel_init(struct terminal *term, int p1, int p2, int p3) 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 ? 0x00000000u - : 0xffu << 24 | (term->vt.attrs.bg_src != COLOR_DEFAULT - ? term->vt.attrs.bg - : term->colors.bg); + : 0xffu << 24 | bg; for (size_t i = 0; i < 1 * 6; i++) term->sixel.image.data[i] = term->sixel.default_bg; |
