Merge pull request #15 from loiccoyle/background_alpha_escape_sequence

Add alpha to background color from escape sequence
This commit is contained in:
Stein Gunnar Bakkeby 2021-04-23 11:29:24 +02:00 committed by GitHub
commit c3ed7be893
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

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]);
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;
}