[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Colours fading to white



Many thanks to the people who responded to my original request.

My solution was first to notice that white is the colour where
red = green = blue = 65536, and that fading a colour to white means
that these components all gradually move to 65535, albeit at
different rates.

I decided that I would fix the number of "steps" through which to pass
from <colour> to white during the fading process, and for each component,
have an associated step size, which is simply the difference between the
original value of that component and 65535, divided by the number of steps.
So at each "fade step", each component of a colour moves towards 65535
until it eventually reaches 65535, all three components arriving there at the
the same time, so achieving a consistent fade (at least more consistent
than I had previously managed: colours fade to white, not black, and do
not cycle through various shades of orange!)

Simple.

Charlene