al_draw_tinted_bitmap(3)
β¨ al_draw_tinted_bitmap β¨
okay bestie, welcome to the Allegro 5 API manual π
this one's a little function with big main character energy β it's literally al_draw_bitmap but with a whole tint situation going on. let's get into it π
πΈ SYNOPSIS πΈ
#include <allegro5/allegro.h>
void al_draw_tinted_bitmap(ALLEGRO_BITMAP *bitmap, ALLEGRO_COLOR tint,
float dx, float dy, int flags)
literally just one header and one call, no cap π«Ά
π DESCRIPTION π
so it's like al_draw_bitmap(3) β same whole vibe β but it multiplies all the colors in the bitmap with the color you pass in as tint. it's giving color filter, it's giving mood lighting, it's iconic β¨
for example:
al_draw_tinted_bitmap(bitmap, al_map_rgba_f(0.5, 0.5, 0.5, 0.5), x, y, 0);
the above will draw the bitmap 50% transparently β and ngl, this part matters: the r/g/b values need to be pre-multiplied with the alpha component when you're using the default blend mode. so don't come for me if it looks weird, that's on the math π
and then:
al_draw_tinted_bitmap(bitmap, al_map_rgba_f(1, 0, 0, 1), x, y, 0);
the above will only draw the red component of the bitmap. red era only π₯ periodt.
π«Ά heads up bestie β see al_draw_bitmap(3) for a note on restrictions on which bitmaps can be drawn where. like, there are rules, and you gotta respect them π
π¦ SEE ALSO π¦
al_draw_bitmap(3)β the un-tinted original, the blueprint, the mother π
that's the whole page, bestie β go forth and tint responsibly π β¨
from the Allegro reference manual, dated 2026-01-31 (source/version: Allegro reference manual) πΈ
π¦ where this page comes from
- arch rolling: allegro 5.2.11.3-2 Β· Zlib AND BSD-3-Clause AND OFL-1.1 AND LicenseRef-Custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms