*
*/
color_t draw_util_hex_to_color(const char *color) {
+ if (strlen(color) < 6 || color[0] != '#') {
+ ELOG("Could not parse color: %s\n", color);
+ return draw_util_hex_to_color("#A9A9A9");
+ }
+
char alpha[2];
if (strlen(color) == strlen("#rrggbbaa")) {
alpha[0] = color[7];
cairo_set_source_rgba(surface->cr, color.red, color.green, color.blue, color.alpha);
}
-/**
+/*
* Draw the given text using libi3.
* This function also marks the surface dirty which is needed if other means of
* drawing are used. This will be the case when using XCB to draw text.
cairo_surface_mark_dirty(surface->surface);
}
-/**
+/*
* Draws a filled rectangle.
* This function is a convenience wrapper and takes care of flushing the
* surface as well as restoring the cairo state.
cairo_restore(surface->cr);
}
-/**
+/*
* Clears a surface with the given color.
*
*/
cairo_restore(surface->cr);
}
-/**
+/*
* Copies a surface onto another surface.
*
*/