al_unmap_rgba(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ al_unmap_rgba β€” Allegro 5 API ✨

okay bestie, welcome to al_unmap_rgba(3alleg5) from the Allegro 5 API πŸ’– this is the one that cracks open a color and hands you back its four little numbers, one by one. it's giving reverse-glow-up and honestly? obsessed.


🌈 SYNOPSIS

#include <allegro5/allegro.h>

void al_unmap_rgba(ALLEGRO_COLOR color,
   unsigned char *r, unsigned char *g, unsigned char *b, unsigned char *a)

like. that's it. that's the whole vibe. one color in, four pointers out 🫢


πŸŽ€ DESCRIPTION

so here's the tea: this function retrieves the components of an ALLEGRO_COLOR(3alleg5) 🎨 you hand it a color, and it unpacks that color into its red, green, blue and alpha pieces for you.

each of those components will range from 0-255 β€” that's the classic byte-scale situation, no decimals, no fractions, just clean whole numbers fr fr πŸ”₯

and the bestie bonus? this function can be called before Allegro is initialized ✨ like, no setup era required, you can just call it whenever. iconic behavior honestly.

heads up: r, g, b and a are all unsigned char * β€” pointers, bestie. so make sure those point at somewhere real before you call this, or it's gonna be a bad time 😭

πŸ‘€ SEE ALSO


that's the whole page, and it lives in the Allegro reference manual, filed under al_unmap_rgba(3alleg5) 🌸 go forth and unmap your colors, you main character πŸ¦‹πŸ‘‘

πŸ’… periodt πŸ’…

πŸ“¦ where this page comes from