makecol8(3)
β¨ makecol8 β¨
okay bestie, gather round, because this is the Allegro manual page for makecol8(3) and it's literally about turning your cute RGB dreams into actual pixels π
πΈ NAME πΈ
makecol8, makecol15, makecol16, makecol24, makecol32 β these convert an RGB value into a display dependent pixel format, from the Allegro game programming library. slay π
β¨ SYNOPSIS β¨
#include <allegro.h>
int makecol8(int r, int g, int b);
int makecol15(int r, int g, int b);
int makecol16(int r, int g, int b);
int makecol24(int r, int g, int b);
int makecol32(int r, int g, int b);
five lil functions, one job, no notes π
π¦ DESCRIPTION π¦
so here's the vibe: these functions take colors from a hardware independent form β that's your red, green, and blue values, each ranging 0-255 β and convert them into the various display dependent pixel formats. glow up for your graphics card, basically β¨
the tea on speed, because I know you're gonna ask:
- converting to 15, 16, 24, or 32-bit formats only takes a few shifts, so it's fairly efficient. lowkey free. ate. π₯
- converting to an 8-bit color is a whole other story though β it involves searching the palette to find the closest match, which is quite slow unless you have set up an RGB mapping table (see below, bestie, it's in SEE ALSO). it's giving "brb checking every single swatch" π
example, because seeing it > reading it:
/* 16 bit color version of green. */
int green_color = makecol16(0, 255, 0);
green. iconic. periodt π
π RETURN VALUE π
returns the requested RGB triplet in the specified color depth. that's it, that's the whole vibe check π«Ά
π SEE ALSO π
makeacol32(3)makecol(3)makecol_depth(3)makecol15_dither(3)rgb_map(3)bestfit_color(3)set_color_depth(3)exrgbhsv(3)
go read those too, they're all in the group chat π
ok that's the whole page, no cap. this was Allegro, version 4.4.3, and the page is makecol8(3) β ty for coming to my ted talk, ily, go make something pretty ππ¦π
π¦ 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