select_palette(3alleg4)

πŸ’– NAME πŸ’–

okay bestie, welcome to select_palette(3alleg4) from the Allegro manual β€” aka the Allegro game programming library ✨. This function is select_palette, and its whole deal is: sets the internal palette for color conversion. That's it. That's the name. Periodt πŸ’….

✨ SYNOPSIS ✨

#include <allegro.h>

void select_palette(const PALETTE p);

πŸŽ€ DESCRIPTION πŸŽ€

Okay so lowkey this one is described as an ugly hack for use in various dodgy situations where you need to convert between paletted and truecolor image formats 😭. No cap.

What it does: it sets the internal palette table in the same way as the set_palette() function, so the conversion will use the specified palette β€” but without affecting the display hardware in any way πŸ¦‹. It's giving "palette for me, not for thee" iykyk.

The previous palette settings are stored in an internal buffer, and can be restored by calling unselect_palette(). Cute, right? 🫢

🚨 Careful bestie: if you call select_palette() again, however, the internal buffer will be overwritten. So don't expect that old palette to come back after a second call β€” she's gone, fr fr πŸ’€.

🌈 SEE ALSO 🌈


Source/version check: this page is from the Allegro manual, version 4.4.3, and the footer didn't print a date, so that's the whole footer vibe β€” no date, just version 4.4.3 and select_palette(3alleg4) energy πŸ’–πŸŽ€. Byeee, go convert something slayfully ✨.