al_draw_tinted_bitmap(3)

πŸ“¦
version 5.2.11.3 Β· 3 versions
, in arch rolling

✨ 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