From ff388cfb40f90db1cba47b5acd043cefc9679b02 Mon Sep 17 00:00:00 2001 From: emcze Date: Wed, 6 Aug 2014 21:44:04 +0200 Subject: [PATCH] fixed color parsing --- bar.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bar.c b/bar.c index 3fed67e..06d20fb 100644 --- a/bar.c +++ b/bar.c @@ -164,8 +164,8 @@ parse_color (const char *str, char **end, const uint32_t def) * Don't do anything if we didn't acquire a rgba visual. */ if (visual != scr->root_visual) { const uint8_t a = ((tmp>>24)&255); - const uint32_t t1 = (tmp&0xff00ff) * (0x100-a); - const uint32_t t2 = (tmp&0x00ff00) * (0x100-a); + const uint32_t t1 = (tmp&0xff00ff) * a / 0x100; + const uint32_t t2 = (tmp&0x00ff00) * a / 0x100; tmp = (a<<24)|(t1&0xff00ff)|(t2&0x00ff00); } return tmp;