I'm wrestling with how to interpolate a color, given a start_time
and end_time
, start_color
and end_color
. For simplicity, here is an example of how I'm thinking of doing it with just the red component:
start_time = 0
end_time = 1
start_color = F //base 16 ftw
end_color = 0
I can see how at time .5, red_out
should be 8. This would be midway through fading from bright red to black.
So is it time_elapsed * start_color
? But then what if it's fading the other way, from black to bright red? This is where I get confused.