summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-11-16 10:21:03 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-11-16 10:21:03 +0900
commitd71c5af33b9b62475987f44ff3fae0eeacff6437 (patch)
tree25ef4ae7fe1263fcbdc6ad570f43461dc642e376 /src
parente89f620324750aae8de9b4d968ee706df5fb4144 (diff)
fix color premul complaints in examples
this should fix T498
Diffstat (limited to 'src')
-rw-r--r--src/bin/test_colorselector.c7
-rw-r--r--src/examples/colorselector_example_01.c4
-rw-r--r--src/examples/transit_example_03.c4
3 files changed, 7 insertions, 8 deletions
diff --git a/src/bin/test_colorselector.c b/src/bin/test_colorselector.c
index 6fb4d6edb..32fb4dc13 100644
--- a/src/bin/test_colorselector.c
+++ b/src/bin/test_colorselector.c
@@ -13,12 +13,7 @@ _colorselector_changed_cb(void *data, Evas_Object *obj,
13 13
14 elm_colorselector_color_get(obj, &r, &g, &b, &a); 14 elm_colorselector_color_get(obj, &r, &g, &b, &a);
15 printf("Changed Color [r=%d g=%d b=%d a=%d]\n", r, g, b, a); 15 printf("Changed Color [r=%d g=%d b=%d a=%d]\n", r, g, b, a);
16 16 evas_color_argb_premul(&a, &r, &g, &b);
17 /* Fix Alpha pre multiplication by edje */
18 r = (r * a) / 255;
19 g = (g * a) / 255;
20 b = (b * a) / 255;
21
22 evas_object_color_set(re, r, g, b, a); 17 evas_object_color_set(re, r, g, b, a);
23} 18}
24 19
diff --git a/src/examples/colorselector_example_01.c b/src/examples/colorselector_example_01.c
index 2afa8b69d..f1ade43e3 100644
--- a/src/examples/colorselector_example_01.c
+++ b/src/examples/colorselector_example_01.c
@@ -67,6 +67,8 @@ _change_color(void *data, Evas_Object *obj, void *event_info)
67{ 67{
68 int r, g, b, a; 68 int r, g, b, a;
69 elm_colorselector_color_get(obj, &r, &g, &b, &a); 69 elm_colorselector_color_get(obj, &r, &g, &b, &a);
70 // ensure colors are pre-multiplied by alpha
71 evas_color_argb_premul(a, &r, &g, &b);
70 evas_object_color_set(data, r, g, b, a); 72 evas_object_color_set(data, r, g, b, a);
71} 73}
72 74
@@ -76,6 +78,8 @@ _colorpalette_clicked_cb(void *data, Evas_Object *obj, void *event_info)
76 int r = 0, g = 0, b = 0 ,a = 0; 78 int r = 0, g = 0, b = 0 ,a = 0;
77 Elm_Object_Item *color_it = (Elm_Object_Item *) event_info; 79 Elm_Object_Item *color_it = (Elm_Object_Item *) event_info;
78 elm_colorselector_palette_item_color_get(color_it, &r, &g, &b, &a); 80 elm_colorselector_palette_item_color_get(color_it, &r, &g, &b, &a);
81 // ensure colors are pre-multiplied by alpha
82 evas_color_argb_premul(a, &r, &g, &b);
79 evas_object_color_set(data, r, g, b, a); 83 evas_object_color_set(data, r, g, b, a);
80} 84}
81 85
diff --git a/src/examples/transit_example_03.c b/src/examples/transit_example_03.c
index 79d6094f8..f0a9a010a 100644
--- a/src/examples/transit_example_03.c
+++ b/src/examples/transit_example_03.c
@@ -27,8 +27,8 @@ static void
27_transit_color(Elm_Transit *trans) 27_transit_color(Elm_Transit *trans)
28{ 28{
29 /* changes the object color from 100, 255, 100, 255 to 29 /* changes the object color from 100, 255, 100, 255 to
30 * 200, 50, 200, 50 */ 30 * 40, 10, 40, 50 */
31 elm_transit_effect_color_add(trans, 100, 255, 100, 255, 200, 50, 200, 50); 31 elm_transit_effect_color_add(trans, 100, 255, 100, 255, 40, 10, 40, 50);
32} 32}
33 33
34static void 34static void