set_palette(3alleg4)
β¨ set_palette β¨
okay bestie, welcome to the set_palette(3alleg4) page from the Allegro manual β yes that Allegro, the game programming library, and yes we're about to talk about 256 colors of pure vibes π
πΈ NAME πΈ
set_palette β sets the entire palette of 256 colors. Allegro game programming library. periodt.
π SYNOPSIS π
#include <allegro.h>
void set_palette(const PALETTE p);
π¦ DESCRIPTION π¦
okay so here's the tea β β this function sets the entire palette of 256 colors, all of them, the whole squad, no stragglers. You gotta hand it an array of 256 RGB structures and it will absolutely deliver. π«Ά
and here's the part that lowkey makes it iconic: unlike set_color(), you do not need to call vsync() before this one. no pre-gaming required, she just goes. π
Example, because a visual is everything:
BITMAP *bmp;
PALETTE palette;
...
bmp = load_bitmap(filename, palette);
if (!bmp)
abort_on_error("Couldn't load bitmap!");
set_palette(palette);
see how it loads the bitmap and the palette in one move? main character energy fr fr. β¨
π SEE ALSO π
set_gfx_mode(3alleg4)set_palette_range(3alleg4)set_color(3alleg4)get_palette(3alleg4)select_palette(3alleg4)palette_color(3alleg4)
iykyk β go read those next, they're all in the same friend group. π
and that's the whole page, bestie!! this was set_palette(3alleg4) from Allegro version 4.4.3 β the Allegro manual, section 3, living its best life. mwah, take care of your palettes and they'll take care of you ππ
π¦ 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