al_map_rgba(3alleg5)

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

πŸ’– al_map_rgba β€” Allegro 5 API πŸ’–

okay bestie, gather round, because this is one of those little functions that you're gonna call like a thousand times and never think about again. it lives in the Allegro 5 manual (section 3alleg5), and it's literally the glow-up station for your colours. ✨


🌸 SYNOPSIS 🌸

#include <allegro5/allegro.h>

ALLEGRO_COLOR al_map_rgba(
   unsigned char r, unsigned char g, unsigned char b, unsigned char a)

πŸŽ€ DESCRIPTION πŸŽ€

so what does it do? it takes your four lil numbers β€” r, g, b, a β€” each one ranging from 0-255 (yes, classic 8-bit-per-channel energy, we love a throwback) and it converts them into an ALLEGRO_COLOR(3alleg5). that's it. that's the whole job. and she does it flawlessly every single time. πŸ’…

the a is the alpha, btw β€” that's your transparency, your main character opacity slider, your "how much do you actually want to be perceived" dial. iykyk. πŸ¦‹

✨ cute bonus fact: this function can be called before Allegro is initialized. so no, you don't have to wait for the whole engine to wake up and do its skincare routine first β€” you can map colours whenever the mood strikes. 🫢

πŸ‘‘ SEE ALSO πŸ‘‘

your sisters, your besties, the whole friend group:

  • al_map_rgb(3alleg5)
  • al_premul_rgba(3alleg5)
  • al_map_rgb_f(3alleg5)

go say hi, they're all iconic. 🌈


and that's the page, bestie! this was the Allegro reference manual β€” that's the source and the whole vibe right there, no date on this one so i'm not gonna make one up, we don't do that here πŸ™ˆ β€” signing off with a little al_map_rgba sparkle for you. go make something pretty. β­πŸŽ€πŸ’œ

πŸ“¦ where this page comes from