X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libi3%2Fget_colorpixel.c;h=b093594e10484d74677752756798062b5178719b;hb=94b1e76af45431f8cb5878679591cd504f629e60;hp=73bbef3d52448ba6911f742132eeefc64253f60f;hpb=0adbffb38621192c416ac52aa6b82ac57fb6394d;p=i3%2Fi3 diff --git a/libi3/get_colorpixel.c b/libi3/get_colorpixel.c index 73bbef3d..b093594e 100644 --- a/libi3/get_colorpixel.c +++ b/libi3/get_colorpixel.c @@ -2,7 +2,7 @@ * vim:ts=4:sw=4:expandtab * * i3 - an improved dynamic tiling window manager - * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE) + * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE) * */ #include @@ -32,5 +32,7 @@ uint32_t get_colorpixel(const char *hex) { uint8_t g = strtol(strgroups[1], NULL, 16); uint8_t b = strtol(strgroups[2], NULL, 16); - return (r << 16 | g << 8 | b); + /* We set the first 8 bits high to have 100% opacity in case of a 32 bit + * color depth visual. */ + return (0xFF << 24) | (r << 16 | g << 8 | b); }