]> git.sur5r.net Git - i3/i3/blobdiff - libi3/get_colorpixel.c
Fix draw_util_copy_surface.
[i3/i3] / libi3 / get_colorpixel.c
index 44ad295d5fc48378a3651dba78bfaea3949f5780..f81ea6c21b378a961c8f2872553e46b0918ab440 100644 (file)
@@ -7,6 +7,7 @@
  */
 #include <stdlib.h>
 #include <stdint.h>
+#include <string.h>
 
 #include "libi3.h"
 
  *
  */
 uint32_t get_colorpixel(const char *hex) {
-    char strgroups[3][3] = {{hex[1], hex[2], '\0'},
-                            {hex[3], hex[4], '\0'},
-                            {hex[5], hex[6], '\0'}};
+    char strgroups[3][3] = {
+        {hex[1], hex[2], '\0'},
+        {hex[3], hex[4], '\0'},
+        {hex[5], hex[6], '\0'}};
     uint8_t r = strtol(strgroups[0], NULL, 16);
     uint8_t g = strtol(strgroups[1], NULL, 16);
     uint8_t b = strtol(strgroups[2], NULL, 16);
 
-    /* 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);
 }