jquery / jquery-color

jQuery plugin for color manipulation and animation support.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Animating from transparent should start from final rgb values

scottgonzalez opened this issue · comments

There are millions of possible values for full transparency, since the only thing that matters is that the alpha value is 0. This means that when animating from transparent to a color, the animation may actually fade between a previous color and the new color (while also fading in). To avoid this, we should set the rgb values to match the end values prior to animating.

You can see the cross-fade in http://jsfiddle.net/jtkj4/8/ when animating from transparent to green. In the process of becoming green, the background actually fades from red because the previous color was rgba( 255, 0, 0, 0 ).

I'll look into this.

Oops, I meant to pull request that one so you could look at it @mikesherov - I had this solution in mind before this issue existed, and didn't realize you were going to attempt it until I came here to get its issue #.

No big deal. I just saw it was open last night.