geta32(3)

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

✨ geta32(3) ✨

okay bestie, so this one lives in the Allegro manual, and it's part of the Allegro game programming library. it's giving "tiny function, big responsibilities" energy and honestly? we love her for it πŸ’…


🌸 NAME 🌸

geta32 β€” pull the alpha component out of a 32-bit pixel format color. yes queen, that's the whole job. (the original says "form" but like, we all know she means "from" 🫢)


πŸŽ€ SYNOPSIS πŸŽ€

#include <allegro.h>

int geta32(int c);

look at that. one include, one function, zero drama. iconic.


πŸ¦‹ DESCRIPTION πŸ¦‹

so basically: you hand her a color that's chillin' in a 32-bit pixel format, and she hands you back just the alpha component. that's it. that's the function.

and the alpha value you get back? it ranges 0-255. so like, fully transparent to fully opaque, the whole range, no cap 🫢

int geta32(int c);
ngl this is the kind of function you forget exists and then spend 45 minutes reinventing badly. she's right there. use her πŸ’–

🌈 SEE ALSO 🌈

  • getr8(3) β€” the red-component bestie, if you're collecting the whole squad πŸ’œ

Allegro, version 4.4.3 β€” that's the source, that's the version, and that's the whole vibe check. mwah, go extract some alpha, you got this πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from