Remove black bars from sixel images and add... (#107)

...support for transparency. Technically, the sixels do not have transparency,
but empty pixels are now rendered with the current background color instead
of black to make the them appear transparent. Same goes for the black bars.
The current background color makes them disappear.

There is one technical limitation with the alpha focus highlight patch.
The alpha value and background color is taken from the current background color,
so when the window is unfocused, images may have the wrong alpha and/or
background color. This can't be fixed easily.
This commit is contained in:
veltza 2023-11-23 22:45:20 +02:00 committed by GitHub
parent 1af2184c87
commit 003ab067da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 7 deletions

View file

@ -30,7 +30,7 @@
// sale, use or other dealings in this Software without prior written
// authorization.
#define SIXEL_RGB(r, g, b) (((r) << 16) + ((g) << 8) + (b))
#define SIXEL_RGB(r, g, b) ((r) + ((g) << 8) + ((b) << 16) + (255 << 24))
int
hls_to_rgb(int hue, int lum, int sat)