I am unsure if it is intended or not, but the problem seems to be that you 
don't have a well defined "base state" to return to when you exit the pressed 
state. The result is that the transition will go from the pressed state to 
undefined and only after it completes does it apply the original color.

The fix is either to mark the transition as "reversible: true" in which case it 
reverts it self based on the original state or perhaps more cleanly, define a 
base state with property changes that the transition can pick up.

cheers,
Gunnar
________________________________________
Fra: interest-bounces+gunnar.sletta=digia....@qt-project.org 
[interest-bounces+gunnar.sletta=digia....@qt-project.org] på vegne av 
Preet [prismatic.proj...@gmail.com]
Sendt: 23. november 2013 01:59
To: <interest@qt-project.org>
Emne: [Interest] QtQuick - ColorAnimation issue with colors that have   alpha

Hi,

I use ColorAnimation to animate a color transition on a rectangle
between two states (say ColorA to ColorB). The default color of the
rectangle is A, and it changes to B when a child MouseArea is pressed.

In the case where ColorA is completely transparent (#00abcdef) and
ColorB is completely opaque, the animation from ColorA->ColorB seems
to work fine. The alpha along with RGB components is faded from A to
B. However, when going back from B to A, it seems like the transition
goes something like ColorB->ColorA(no alpha)->Black->ColorA

This doesn't happen if ColorB has any alpha in it. There's a quick
work around by making ColorB nearly opaque (ie. "#FEabcdef")

Here's a simple example:
http://pastebin.kde.org/pixaqd47y

I'm on Qt 5.2, somewhere around beta from git. Is this a bug?


Preet
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to