set_color(3alleg4)

πŸ’… set_color β€” bestie edition πŸ’…

okay so this is set_color, from the Allegro manual (the 3alleg4 girlies know). it lives in the Allegro game programming library and it's literally the tiniest little palette glow-up function you'll ever meet. don't let the size fool you though, she has ✨opinions✨ about when you're allowed to call her.


🌸 NAME 🌸

set_color β€” sets the specified palette entry to the specified RGB triplet, and she's part of the Allegro game programming library family πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <allegro.h>

void set_color(int index, const RGB *p);

✨ DESCRIPTION ✨

so basically: you hand her a palette index and a pointer to an RGB triplet, and she paints that one palette entry with exactly those colors. one entry. one triplet. no drama. πŸ’–

BUT here's the tea, and it's important tea: unlike all her other palette-function besties, she does NOT do any retrace synchronisation. like, zero. none. so if you just rawdog it mid-frame you're gonna get snow problems (yes that's the real name, yes it looks like TV static, no it's not cute). the fix? call vsync() before her, every time. think of it as her little pre-game ritual 🫢

here's the example straight from the source, no cap:

RGB rgb;
...
vsync();
set_color(192, &rgb);

see? vsync() first, then the glow-up. that's the whole vibe check. slay πŸ’…

lowkey obsessed with how simple she is, but highkey do NOT skip the vsync() or the snow will find you 🌨️😭

πŸ‘‘ SEE ALSO πŸ‘‘

the whole friend group, fr fr:


and that's the whole page bestie!! this iconic little entry came to you courtesy of Allegro, version 4.4.3 β€” main character energy from the Allegro manual, forever and always. periodt. πŸ’–πŸŽ€βœ¨