palette_color(3)
π¦ palette_color(3) π¦
okay bestie, we're in the Allegro manual and this page is all about palette_color(3) β the palette index β pixel format translator, no cap. It's part of the Allegro game programming library, and it's lowkey iconic. Let's get into it. π
β¨ NAME β¨
palette_color β maps palette indexes into the current pixel format colors. Allegro game programming library.
πΈ SYNOPSIS πΈ
#include <allegro.h>
extern int palette_color[256];
π DESCRIPTION π
So palette_color is a table, bestie. It maps palette index colors (0-255) into whatever pixel format is being used by the current display mode. Literally a glow-up from palette index to on-screen pixel value. β¨
In a 256-color mode, it's giving simple: this just maps onto the array index. In truecolor modes, it looks up the specified entry in the current palette, and converts that RGB value into the appropriate packed pixel format. Obsessed. π«Ά
Example, because we love a demo:
set_color_depth(32);
...
set_palette(desktop_palette);
/* Put a pixel with the color 2 (green) of the palette */
putpixel(screen, 100, 100, palette_color[2]);
π SEE ALSO π
mwah π this page comes from the Allegro manual, version 4.4.3 β source/version check, and the footer didn't hand us a date, so that's the whole footer tea. bye bestie π«Άβ¨
π¦ where this page comes from
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms