fix color premul complaints in examples

this should fix T498
This commit is contained in:
Carsten Haitzler 2013-11-16 10:21:03 +09:00
parent cf2ae7397e
commit 9c96c4fa36
3 changed files with 7 additions and 8 deletions

View File

@ -13,12 +13,7 @@ _colorselector_changed_cb(void *data, Evas_Object *obj,
elm_colorselector_color_get(obj, &r, &g, &b, &a);
printf("Changed Color [r=%d g=%d b=%d a=%d]\n", r, g, b, a);
/* Fix Alpha pre multiplication by edje */
r = (r * a) / 255;
g = (g * a) / 255;
b = (b * a) / 255;
evas_color_argb_premul(&a, &r, &g, &b);
evas_object_color_set(re, r, g, b, a);
}

View File

@ -67,6 +67,8 @@ _change_color(void *data, Evas_Object *obj, void *event_info)
{
int r, g, b, a;
elm_colorselector_color_get(obj, &r, &g, &b, &a);
// ensure colors are pre-multiplied by alpha
evas_color_argb_premul(a, &r, &g, &b);
evas_object_color_set(data, r, g, b, a);
}
@ -76,6 +78,8 @@ _colorpalette_clicked_cb(void *data, Evas_Object *obj, void *event_info)
int r = 0, g = 0, b = 0 ,a = 0;
Elm_Object_Item *color_it = (Elm_Object_Item *) event_info;
elm_colorselector_palette_item_color_get(color_it, &r, &g, &b, &a);
// ensure colors are pre-multiplied by alpha
evas_color_argb_premul(a, &r, &g, &b);
evas_object_color_set(data, r, g, b, a);
}

View File

@ -27,8 +27,8 @@ static void
_transit_color(Elm_Transit *trans)
{
/* changes the object color from 100, 255, 100, 255 to
* 200, 50, 200, 50 */
elm_transit_effect_color_add(trans, 100, 255, 100, 255, 200, 50, 200, 50);
* 40, 10, 40, 50 */
elm_transit_effect_color_add(trans, 100, 255, 100, 255, 40, 10, 40, 50);
}
static void