aboutsummaryrefslogtreecommitdiffstats
path: root/common/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/util.c')
-rw-r--r--common/util.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/common/util.c b/common/util.c
index 84ebab99..c7ef2ac4 100644
--- a/common/util.c
+++ b/common/util.c
@@ -31,6 +31,13 @@ bool parse_color(const char *color, uint32_t *result) {
31 return true; 31 return true;
32} 32}
33 33
34void color_to_rgba(float dest[static 4], uint32_t color) {
35 dest[0] = ((color >> 24) & 0xff) / 255.0;
36 dest[1] = ((color >> 16) & 0xff) / 255.0;
37 dest[2] = ((color >> 8) & 0xff) / 255.0;
38 dest[3] = (color & 0xff) / 255.0;
39}
40
34bool parse_boolean(const char *boolean, bool current) { 41bool parse_boolean(const char *boolean, bool current) {
35 if (strcasecmp(boolean, "1") == 0 42 if (strcasecmp(boolean, "1") == 0
36 || strcasecmp(boolean, "yes") == 0 43 || strcasecmp(boolean, "yes") == 0