makeacol(3alleg4)

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

okay so bestie, we're in the Allegro manual, 3alleg4 section, and today's main character is makeacol (and its lil sibling makeacol_depth). they convert RGBA colors into display dependent pixel formats. that's the whole vibe. πŸŽ€


✨ NAME ✨

makeacol, makeacol_depth β€” converts RGBA colors into display dependent pixel formats. Allegro game programming library.


🌸 SYNOPSIS 🌸

#include <allegro.h>

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

int makeacol_depth(int color_depth, int r, int g, int b, int a);

πŸ¦‹ DESCRIPTION πŸ¦‹

so these two convert RGBA colors into display dependent pixel formats. πŸ’…

here's the tea: in anything less than a 32-bit mode, these are literally the same as calling makecol() or makecol_depth(). same thing, no notes. but β€” and this is the iconic part β€” by using these routines it is possible to create 32-bit color values that contain a true 8 bit alpha channel along with the red, green, and blue components. so like, a real alpha channel, not a vibe. ✨

⚠️ okay important, bestie: you should only use RGBA format colors as the input to draw_trans_sprite() or draw_trans_rle_sprite() after calling set_alpha_blender(), rather than drawing them directly to the screen. do not just yeet them at the screen. that's not the move. 😭

πŸ‘‘ RETURN VALUE πŸ‘‘

returns the requested RGBA quadruplet. that's it, that's the whole thing. she delivers. 🫢


🌈 SEE ALSO 🌈


Allegro version 4.4.3 πŸ’– and yeah, that's the page β€” makeacol(3alleg4) said what she said. go make some 32-bit alpha magic, bestie, ily. 🧚✨