[thelist] Javascript (Math Skills Needed)

Luther, Ron Ron.Luther at hp.com
Wed Aug 8 13:26:49 CDT 2007

Christian Heilmann noted:

>>Actually it is a lot more tricky, as the function assumes 
>>that all the values are increased in the same amount. You 
>>need to check the three independent from another.

Hi Christian,

I don't know what the original textbook function had, but in the
modified code Jon showed I thought the increments already looked to be
both independent and normalized (to 1/10th the difference between actual
and goal). 

Initially I was thinking that the issue with fading to an arbitrary
colour value would involve considering the direction of incremental
deltas for each register since it's assumed to be positive when you fade
to white. (And if you are really really picky you might alternate
between 'ceiling' and 'floor' functions when the deltas are positive or
negative.)  After a little thought I'm not sure it really makes much
difference, probably nothing visible to most folks anyway.

... Actually, now I'm kinda wondering if maybe it's already working!
Without seeing the colors side by side some folks (like me) might
actually have trouble seeing the difference between the original #FFFFFF
and the desired #F3F4FF.  It's different, but it's not a very dramatic
difference.  I would suggest fading to a nice #33CC00 for debugging
purposes ... and *then* changing the values to the desired #F3F4FF once
convinced things are working well and well understood.

I would also suggest keeping gimp or some other color picker program
open so you can eyedropper the faded image and check the actual realized
numerical value of the fade ... maybe, for example, that last loop isn't
incrementing properly.  That can be real hard to see by eye - especially
when comparing two very similar light shades (like this) - or if you are
like me and don't have calibrated eyes!  ;-)


More information about the thelist mailing list