From f7730166807252159475a77976b63545f970d55f Mon Sep 17 00:00:00 2001 From: Bakkeby Date: Thu, 14 Mar 2024 22:30:15 +0100 Subject: [PATCH] alpha: multiply each RGB value with alpha for a darker blend --- x.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/x.c b/x.c index 06ac5c4..cfa4411 100644 --- a/x.c +++ b/x.c @@ -1018,6 +1018,9 @@ xloadcols(void) dc.col[defaultbg].color.alpha = (unsigned short)(0xffff * alpha); dc.col[defaultbg].pixel &= 0x00FFFFFF; dc.col[defaultbg].pixel |= (unsigned char)(0xff * alpha) << 24; + dc.col[defaultbg].color.red *= alpha; + dc.col[defaultbg].color.green *= alpha; + dc.col[defaultbg].color.blue *= alpha; #endif // ALPHA_PATCH loaded = 1; } @@ -1058,6 +1061,9 @@ xsetcolorname(int x, const char *name) dc.col[defaultbg].color.alpha = (unsigned short)(0xffff * alpha); dc.col[defaultbg].pixel &= 0x00FFFFFF; dc.col[defaultbg].pixel |= (unsigned char)(0xff * alpha) << 24; + dc.col[defaultbg].color.red *= alpha; + dc.col[defaultbg].color.green *= alpha; + dc.col[defaultbg].color.blue *= alpha; } #endif // ALPHA_PATCH return 0;