fade_in_range(3alleg4)

✨ NAME ✨

fade_in_range β€” the glow-up arc where a slice of your palette goes from absolute darkness to full color πŸ’– (and yes bestie, this one lives in the Allegro game programming library πŸŽ€)


🌸 SYNOPSIS 🌸

#include <allegro.h>

void fade_in_range(const PALETTE p, int speed, int from, int to);

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so picture this: screen is pure black, total void, nothing going on 😭. fade_in_range takes a chunk of your palette and gently fades it in from that blackness until it matches the palette you handed it. It's giving sunrise but for colors. Iconic.

The speed is a whole number from 1 (the slowest, the most dramatic, the slow-burn) all the way up to 64 (instantaneous β€” no fade, just boom, done). Pick your vibe.

Now here's the part you actually need: this routine only touches the colors between from and to β€” and that range is inclusive on both ends, no cap. So if you want to fade the entire palette, pass 0 and 255. That's the whole thing, every single color, main character energy πŸ‘‘.

⚠️ Two things, fr fr, don't skip these: - This function will block your game while the fade is in effect. Like, it takes over. Your loop is not running, bestie, it's just sitting there waiting for the fade to finish 🫠. - It won't work right visually if you're not in an 8 bit color depth resolution. So if it looks cursed, that's why. Check your depth first πŸ’€.

🌈 SEE ALSO 🌈

  • fade_in(3alleg4) β€” the whole-palette sibling, when you want the full glow-up instead of a slice ✨

k bye, go fade something beautiful πŸ’œ

Allegro, version 4.4.3 β€” mwah, love that for us 🫢