fade_interpolate(3alleg4)
π fade_interpolate β bestie edition π
okay so this is one of those Allegro manual pages, from the Allegro game programming library, and it's genuinely such a slay little function. sit with me for a sec π«Ά
β¨ NAME β¨
fade_interpolate β calculates a new palette interpolated between two others, and yes it does exactly what it says on the tin π
πΈ SYNOPSIS πΈ
#include <allegro.h>
void fade_interpolate(const PALETTE source, const PALETTE dest, PALETTE
output, int pos, int from, int to);
π¦ DESCRIPTION π¦
so basically, bestie, this function cooks up a temporary palette that sits partway between source and dest, and it hands it back to you in the output parameter. no cap.
where exactly it lands between those two extremes? that's all on pos, and the vibes are:
pos=0β you get an exact copy ofsourcepos=64β you getdestpos=32β you get a palette half way between the two- etc. β you get the pattern, it's giving very much linear interpolation energy β¨
and here's the little detail that matters: this routine only affects the colors between from and to, and that range is inclusive. so if you want to interpolate the entire palette, pass 0 and 255. periodt. π
π SEE ALSO π
not me being obsessed with a palette lerp function... but fr fr,0and255for the whole thing, don't forget, or you'll be sitting there like π wondering why half your palette didn't move.
and that's the whole page, bestie! this was the Allegro manual, version 4.4.3, and you just read fade_interpolate(3alleg4). go interpolate something gorgeous πβ¨ππ¦
π¦ where this page comes from
- debian bookworm: allegro4-doc 2:4.4.3.1-3 Β· Allegro-gift-ware
- debian trixie: allegro4-doc 2:4.4.3.1-5 Β· Allegro-gift-ware
- ubuntu jammy: allegro4-doc 2:4.4.3.1-2 Β· Allegro-gift-ware
- ubuntu noble: allegro4-doc 2:4.4.3.1-4.1build3 Β· Allegro-gift-ware
- ubuntu questing: allegro4-doc 2:4.4.3.1-6
- ubuntu resolute: allegro4-doc 2:4.4.3.1-7 Β· Allegro-gift-ware
- ubuntu stonking: allegro4-doc 2:4.4.3.1-9 Β· Allegro-gift-ware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms