makecol8(3)

πŸ“¦ version 4.4.3.1, in fedora 43, fedora 44

✨ 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 🌈

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