1) You could simplify the math:

 new[i] = (1-percent)*from[i] + percent*to[i]

At least that makes a little more sense to me.  You are reducing from by the 
inverse of the percent that you are adding to.  Also, it saves an array 
reference.

2) I was going to say you need to worry about clipping, but internalfromrgba 
takes care of that.

3) I don't like the name 'tween'.  This is really the same operation that we 
already call 'tint'.  If that doesn't fly, how about 'blend'.  To me, 'tween' 
carries the connotation that many intermediate values are created.

4) For completeness, it seems to me you ought to also support a `blendHSVA` 
method, since you usually get more intuitive results animating along those axes.
  
On 2010-11-23, at 14:28, Max Carlson wrote:

> Change maxcarlson-20101123-M5Y by maxcarl...@friendly on 2010-11-23 11:19:45 
> PST
>    in /Users/maxcarlson/openlaszlo/trunk-clean
>    for http://svn.openlaszlo.org/openlaszlo/trunk
> 
> Summary: Aad LzColorUtils.tweenRGBA() method
> 
> Bugs Fixed: LPP-9542 - Allow color values to be animated (partial)
> 
> Technical Reviewer: ptw
> QA Reviewer: hminsky
> 
> Details: Add tweenRGBA() method to pick apart a color's r g b a components an 
> interpolate between them.
> 
> Tests: IWFM!
> 
> Files:
> M       WEB-INF/lps/lfc/services/LzUtils.lzs
> 
> Changeset: 
> http://svn.openlaszlo.org/openlaszlo/patches/maxcarlson-20101123-M5Y.tar


Reply via email to