From ec513b230ab51f3a6fadbe22c18bf009881f351a Mon Sep 17 00:00:00 2001 From: Loic Coyle Date: Thu, 22 Apr 2021 20:49:05 +0200 Subject: [PATCH] Add alpha to background color from escape sequence --- x.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/x.c b/x.c index 43e28b4..4bb4199 100644 --- a/x.c +++ b/x.c @@ -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; }