makecol(3alleg4)
π makecol β the glow-up your RGB deserves π
okay bestie, welcome to makecol(3alleg4), straight out of the Allegro game programming library manual. this one is short, sweet, and honestly iconic. let's get into it π«Ά
β¨ NAME β¨
makecol β converts an RGB value into the current pixel format. also: this is part of the Allegro game programming library, iykyk π
πΈ SYNOPSIS πΈ
#include <allegro.h>
int makecol(int r, int g, int b);
like. that's it. three little ints and a dream π
π¦ DESCRIPTION π¦
so here's the vibe: you've got a color in a hardware independent format β that's your red, green, and blue values, each one ranging 0-255 β and makecol is the bestie that translates it into whatever pixel format your current video mode is actually asking for. no cap. it does this by calling the preceding 8, 15, 16, 24, or 32-bit makecol functions as appropriate, depending on what it's working with. it just picks the right one for you, main character energy honestly β¨
example time, look:
/* Regardless of color depth, this will look green. */
int green_color = makecol(0, 255, 0);
see how that comment says regardless of color depth? that's the whole point, babes. you write the color once, it slays in any depth. π
π RETURN VALUE π
it returns the requested RGB triplet, expressed in the current color depth. that's the whole gift. that's the whole package. periodt. π
π SEE ALSO π
the squad, the friend group, the ones you should also go read:
makeacol(3alleg4)makecol8(3alleg4)makecol_depth(3alleg4)makecol15_dither(3alleg4)rgb_map(3alleg4)set_color_depth(3alleg4)
ngl there's nothing dangerous in here, it's just colors. go make something pretty. π¨
Allegro, version 4.4.3 β and this page is makecol(3alleg4). mwah, love u, bye πππ§
π¦ 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