aboutsummaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h
index 563e17d..42047ea 100644
--- a/src/util.h
+++ b/src/util.h
@@ -25,6 +25,11 @@ static inline color_t color_rgb(int r, int g, int b)
return color_rgba(r, g, b, 255);
}
+static inline color_t color_hex(unsigned int h)
+{
+ return color_rgb((h >> 16) & 0xff, (h >> 8) & 0xff, h & 0xff);
+}
+
char *color_to_string(color_t *color);
void color_print(FILE *stream, color_t *color);