dankamongmen / panelreels

high-level objects built atop ncurses
https://nick-black.com/dankwiki/index.php/Outcurses
Apache License 2.0
8 stars 1 forks source link

Palette fade ought be opportunistic #7

Closed dankamongmen closed 4 years ago

dankamongmen commented 5 years ago

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,

dankamongmen commented 4 years ago

improved-fade

dankamongmen commented 4 years ago

w00t, I think this is working about as well as it can following #11!