Hacker News new | ask | show | jobs
by bbbbbr 1885 days ago
Also handy for smooth palette fades using only integers.

It makes it easy to do linear interpolation (lerp) between two RGB colors (or in another color space if you want better color consistency during transition). The transition between each component gets be spaced out over a constant duration regardless of how little integer difference there actually is.

I used this approach to add a color fade transition effect for a Game Boy color puzzle game (made using GBDK). GIF of the effect here: https://twitter.com/0xbbbbbr/status/1350982144450027525