]> git.sur5r.net Git - i3/i3/blobdiff - libi3/get_colorpixel.c
Implement new 'sticky' command to manually set, remove or toggle the sticky state...
[i3/i3] / libi3 / get_colorpixel.c
index 73bbef3d52448ba6911f742132eeefc64253f60f..44ad295d5fc48378a3651dba78bfaea3949f5780 100644 (file)
@@ -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 Michael Stapelberg and contributors (see also: LICENSE)
  *
  */
 #include <stdlib.h>
@@ -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);
 }