makeacol32(3)

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

πŸ’– makeacol32 β€” the Allegro manual, but make it cute πŸ’–

okay bestie, welcome to the Allegro manual, page makeacol32(3). this is a real one, from the Allegro game programming library, and we're gonna get you fluent in it. pull up a chair, grab a strawberry, let's go πŸ“


✨ NAME ✨

makeacol32 β€” takes an RGBA color and converts it into a 32-bit display pixel format. it's giving Allegro game programming library energy, and honestly? iconic πŸ‘‘


🌸 SYNOPSIS 🌸

#include <allegro.h>

int makeacol32(int r, int g, int b, int a);

like, that's it. four little ints and she's ready to serve πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so basically, makeacol32 converts an RGBA color into a 32-bit display pixel format β€” and the alpha (transparency) value is the whole point here. that's the A in RGBA, and she's the main character, no cap ✨

now, the way this works: there are no versions of this routine for other color depths, and that's not an oversight, bestie, that's math. only the 32-bit format has enough room to store a proper alpha channel. the other depths literally don't have the space. it's giving small purse, can't fit the whole alpha πŸ‘œπŸ˜­

and here's the part you need to hear:

you should only use RGBA format colors as the input to draw_trans_sprite() or draw_trans_rle_sprite() after calling set_alpha_blender(). do not just draw them directly to the screen. that's not it, that's not the vibe, don't do it πŸ™ˆ

so the order matters, fr fr. RGBA color β†’ set_alpha_blender() β†’ then hand it to draw_trans_sprite() or draw_trans_rle_sprite(). slay in that order or it won't slay at all πŸ’…


πŸ’œ SEE ALSO πŸ’œ

go read those next, bestie, they're the rest of the squad 🫢


and that's the whole page, babes. this was Allegro version 4.4.3, makeacol32(3), dropping into your terminal like the icon it is. mwah πŸ’‹πŸŒˆβ­

πŸ“¦ where this page comes from