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:
set_palette(3alleg4)β the one who does handle the sync stuff πget_color(3alleg4)β reading girlies, she sees you πΈ_set_color(3alleg4)β the underscore twin, iykyk π§ex12bit(3alleg4)β example bestie β¨exrgbhsv(3alleg4)β example bestie, color-space edition πexscroll(3alleg4)β example bestie, scrolling edition π¦
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. ππβ¨
π¦ 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