[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [E-devel] Evas and alpha premul color data
I'm forwarding the messages that Jose sent me because he seems to be
detected as a spammer by the ML service.
----- Forwarded Message -----
Date: Sat, 24 Jun 2006 07:10:42 GMT
From: "firstname.lastname@example.org" <email@example.com>
Subject: Re: [E-devel] Evas and alpha premul color data
> > And I forgot to mention another problem I have in mind.
> > For now, in edje, if you want to do a color transition from
> > color1="255 0 0 255" to color2="0 255 0 0", you have to
> > create 2 states, the first associated to color1, and the second
> > to color2.
> > With "alpha premul" colors, it will become (if I understand
> > correctly): color1'="255 0 0 255" and color2'="0 0 0 0".
> > So how Edje will guess it has to make a transition from red
> > to green? Or we'll have to keep "normal" colors in edje, but
> > it won't be coherent with the API of evas :/
> > Simon
> Ummm, that's odd... Edje should not consider the color
> 0 255 0 0 as "green". It should be transparent - that's what
> evas will do with such an input color.. if an obj's color has
> alpha = 0, the obj is transparent.
> To transition to green one should set color2 to be,
> green! ie. 0 255 0 255.
> If edje is doing otherwise then it has a bug, or
> something funky :(
No, it's ok :) I see what you mean.. How would it
know that it should transition thru something half-way that
is partly-red partly-green partly-transparent, ie. that at the
half-way point of the transition the color should be set to
128 128 0 128
It wouldn't, that's correct. That's part of the problem
of dealing with non-premul colors, it gives a bad idea of what
is actually going to be displayed.
In order to get a transition that varies from opaque-red,
to half-opaque-brownish, to transparent, you'd need to transition
between these *three* premul colors, ie. you'd need three premul
colors to transition from, not just two.
The thing about using premul colors is that it gives
you a very exact, direct idea of what you'll actually get
displayed, whereas non-premul colors give an indirect idea
This is why I think it's such a bad idea to mix the
two -- it creates confusion as to what should be happenning.
If you stick to using premul colors, you always get a good
idea of what is going to be displayed.
Please feel free to forward/copy these emails to the elist.