- if (col[0] == '#') {
- unsigned int red, green, blue;
- if (sscanf(col + 1, "%02x%02x%02x", &red, &green, &blue) == 3) {
- /* 2**16 - 1 == 0xffff and 0x101 * 0xij == 0xijij */
- red *= 0x101;
- green *= 0x101;
- blue *= 0x101;
- xcb_alloc_color_reply_t *reply = xcb_alloc_color_reply(dpy, xcb_alloc_color(dpy, map, red, green, blue), NULL);
- if (reply != NULL) {
- *pxl = reply->pixel;
- free(reply);
- return true;
- }
- }
- } else {
- xcb_alloc_named_color_reply_t *reply = xcb_alloc_named_color_reply(dpy, xcb_alloc_named_color(dpy, map, strlen(col), col), NULL);
- if (reply != NULL) {
- *pxl = reply->pixel;
- free(reply);
- return true;
- }
- }
- *pxl = 0;
- return false;
+ if (col[0] == '#') {
+ unsigned int red, green, blue;
+ if (sscanf(col + 1, "%02x%02x%02x", &red, &green, &blue) == 3) {
+ /* 2**16 - 1 == 0xffff and 0x101 * 0xij == 0xijij */
+ red *= 0x101;
+ green *= 0x101;
+ blue *= 0x101;
+ xcb_alloc_color_reply_t *reply = xcb_alloc_color_reply(dpy, xcb_alloc_color(dpy, map, red, green, blue), NULL);
+ if (reply != NULL) {
+ *pxl = reply->pixel;
+ free(reply);
+ return true;
+ }
+ }
+ } else {
+ xcb_alloc_named_color_reply_t *reply = xcb_alloc_named_color_reply(dpy, xcb_alloc_named_color(dpy, map, strlen(col), col), NULL);
+ if (reply != NULL) {
+ *pxl = reply->pixel;
+ free(reply);
+ return true;
+ }
+ }
+ *pxl = 0;
+ return false;