forked from enlightenment/efl
evas: all color in evas are premultiplied, enforce with warning when not.
This commit is contained in:
parent
b54897dc27
commit
cd1f09d359
|
@ -105,6 +105,26 @@ _efl_vg_base_efl_gfx_base_color_set(Eo *obj EINA_UNUSED,
|
|||
Efl_VG_Base_Data *pd,
|
||||
int r, int g, int b, int a)
|
||||
{
|
||||
if (r > 255) r = 255; if (r < 0) r = 0;
|
||||
if (g > 255) g = 255; if (g < 0) g = 0;
|
||||
if (b > 255) b = 255; if (b < 0) b = 0;
|
||||
if (a > 255) a = 255; if (a < 0) a = 0;
|
||||
if (r > a)
|
||||
{
|
||||
r = a;
|
||||
ERR("Evas only handles pre multiplied colors!");
|
||||
}
|
||||
if (g > a)
|
||||
{
|
||||
g = a;
|
||||
ERR("Evas only handles pre multiplied colors!");
|
||||
}
|
||||
if (b > a)
|
||||
{
|
||||
b = a;
|
||||
ERR("Evas only handles pre multiplied colors!");
|
||||
}
|
||||
|
||||
pd->r = r;
|
||||
pd->g = g;
|
||||
pd->b = b;
|
||||
|
|
Loading…
Reference in New Issue