summaryrefslogtreecommitdiff
path: root/src/util/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/util.c')
-rw-r--r--src/util/util.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/util/util.c b/src/util/util.c
index c325b4d..a7c1d8e 100644
--- a/src/util/util.c
+++ b/src/util/util.c
@@ -20,6 +20,20 @@
#include "util/util.h"
+void util_set_alpha_color(Evas_Object *obj, int alpha)
+{
+ int r, g, b, a;
+
+ evas_object_color_get(obj, &r, &g, &b, &a);
+
+ /* evas should use premultiplied alpha */
+ r = r * alpha / 255;
+ g = g * alpha / 255;
+ b = b * alpha / 255;
+
+ evas_object_color_set(obj, r, g, b, alpha);
+}
+
Evas_Object *util_add_box(Evas_Object *base)
{
Evas_Object *box;