From 00059d2d73009883ad666c44d2449004fff2257e Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sat, 7 Apr 2012 22:03:38 +0200 Subject: [PATCH] C color code: Ignore alpha component (FS#966) The only place where we silently have to ignore alpha components are window borders and systray background. However, because these color strings could be coming from the beautiful theme, we shouldn't error out when an alpha component is present. With this commit, we silently ignore this alpha component. Signed-off-by: Uli Schlachter --- color.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/color.c b/color.c index a8a12d27..c05b07fe 100644 --- a/color.c +++ b/color.c @@ -46,6 +46,13 @@ color_parse(const char *colstr, ssize_t len, char *p; colnum = strtoul(colstr + 1, &p, 16); + if(len == 9 && (p - colstr) == 9) + { + /* We ignore the alpha component */ + colnum >>= 8; + len -= 2; + p -= 2; + } if(len != 7 || colstr[0] != '#' || (p - colstr) != 7) { warn("awesome: error, invalid color '%s'", colstr);