* 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>
#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);
- return (r << 16 | g << 8 | b);
+ return (0xFF << 24) | (r << 16 | g << 8 | b);
}