fade_from_range(3alleg4)

✨ NAME ✨

fade_from_range β€” lowkey fades a part of the palette between two other palettes, bestie. This is from the Allegro game programming library, and it's giving glow-up energy πŸ’«


🌸 SYNOPSIS 🌸

#include <allegro.h>

void fade_from_range(const PALETTE source, const PALETTE dest, int speed, int from, int to);

πŸŽ€ DESCRIPTION πŸŽ€

Okay so picture this: you've got your source palette, you've got your dest palette, and you want the vibes to gradually shift from one to the other. That's literally what this does. It fades a part of the palette from the source palette over to the dest palette, smooth like butter 🧈✨

The speed goes from 1 (the slowest, most dramatic, main character slow-mo walk) all the way up to 64 (instantaneous β€” blink and it's done, no thoughts, head empty πŸ’€).

And here's the tea: this routine only affects the colors between from and to, and yes that's inclusive. Want to fade the entire palette? Pass 0 and 255. Easy. Periodt. πŸ’…

Heads up bestie, two things you need to know: - This function will block your game while the fade is in effect. Like, it fully commits. Nothing else is happening until it's done 😭 - It also won't work right visually if you are not in an 8 bit color depth resolution. Just so you know, no cap. πŸ™ˆ

πŸ¦‹ SEE ALSO πŸ¦‹


Allegro manual, version 4.4.3 β€” mwah, thanks for reading, you ate this whole page up fr fr πŸ”₯πŸ‘‘ stay iconic, and go make something pretty fade in and out of existence like the queen you are πŸ’–βœ¨πŸŽ€