With #5 done, we have a working palette fade, but it could be a lot better. We shouldn't always sleep the quanta, but instead we ought sleep however long (if at all) we need until the next scheduled dimming.
At start, divide the requested nanoseconds by 256 (or ideally by the brightest used color component). This is the time step of an ideal fade. I.e. if we wanted to fade across 256s, we'd ideally each second N set (N/256)*c_component_orig, and sleep for about 1s.
but we might be too fast or too slow. instead,
copy the initial color tables. along the way, find the maximum of each component.
** max of r_max, g_max, b_max is maxiters // maximum number of useful loop iterations
With #5 done, we have a working palette fade, but it could be a lot better. We shouldn't always sleep the quanta, but instead we ought sleep however long (if at all) we need until the next scheduled dimming.
At start, divide the requested nanoseconds by 256 (or ideally by the brightest used color component). This is the time step of an ideal fade. I.e. if we wanted to fade across 256s, we'd ideally each second N set (N/256)*c_component_orig, and sleep for about 1s.
but we might be too fast or too slow. instead,