Add alpha to background color from escape sequence

This commit is contained in:
Loic Coyle 2021-04-22 20:49:05 +02:00
parent 08f137a8a0
commit ec513b230a

10
x.c
View File

@ -813,6 +813,16 @@ xsetcolorname(int x, const char *name)
XftColorFree(xw.dpy, xw.vis, xw.cmap, &dc.col[x]); XftColorFree(xw.dpy, xw.vis, xw.cmap, &dc.col[x]);
dc.col[x] = ncolor; dc.col[x] = ncolor;
#if ALPHA_PATCH
/* set alpha value of bg color */
if (x == defaultbg) {
if (opt_alpha)
alpha = strtof(opt_alpha, NULL);
dc.col[defaultbg].color.alpha = (unsigned short)(0xffff * alpha);
dc.col[defaultbg].pixel &= 0x00FFFFFF;
dc.col[defaultbg].pixel |= (unsigned char)(0xff * alpha) << 24;
}
#endif // ALPHA_PATCH
return 0; return 0;
} }