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 <psychon@znc.in>
This commit is contained in:
parent
5c7a3501d0
commit
00059d2d73
7
color.c
7
color.c
|
@ -46,6 +46,13 @@ color_parse(const char *colstr, ssize_t len,
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
colnum = strtoul(colstr + 1, &p, 16);
|
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)
|
if(len != 7 || colstr[0] != '#' || (p - colstr) != 7)
|
||||||
{
|
{
|
||||||
warn("awesome: error, invalid color '%s'", colstr);
|
warn("awesome: error, invalid color '%s'", colstr);
|
||||||
|
|
Loading…
Reference in New Issue