On Tue, Apr 28, 2009 at 9:41 AM, Viktor Kojouharov
<vkojouha...@gmail.com> wrote:
> On Tue, 2009-04-28 at 09:11 -0300, Gustavo Sverzut Barbieri wrote:
>> On Tue, Apr 28, 2009 at 5:30 AM, Enlightenment SVN
>> <no-re...@enlightenment.org> wrote:
>> > Log:
>> >  fix the xpixmap window resizing
>> >            evas_object_color_set (o, 255, 255, 255, 50);
>>
>> hummmmmmmmmm.. even this line not being changed in the commit, i just
>> spotted it and it is wrong!
>>
>> in Evas you need colors pre-multiplied, so every R, G and B should be
>> <= A, so it is impossible to have 255 red with 50 alpha. In this case,
>> use 50 50 50 50. You can google a bit more for pre-multiplied color
>> system.
>>
> thanks. I was wondering why the rect was not transparent. I really need
> to understand what values make for correct colors. e.g.: I have no idea
> why the rgb have to be 50 with a 50 alpha value. Can I for instance have
> 99 132 172 (light blue) with a 200 alpha?

sure, they need to be <= A. Math is simple:

r_premul = (r * a) / 255;  (a = 255, r_premul == r;   a = 0, r_premul == 0)
g_premul = (g * a) / 255;  (a = 255, g_premul == g;   a = 0, g_premul == 0)
b_premul = (b * a) / 255;  (a = 255, b_premul == b;   a = 0, b_premul == 0)

-- 
Gustavo Sverzut Barbieri
http://profusion.mobi embedded systems
--------------------------------------
MSN: barbi...@gmail.com
Skype: gsbarbieri
Mobile: +55 (19) 9225-2202

------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to