---
name: "al_premul_rgba_f"
section: "3"
platform: "linux"
package: "allegro"
version: "5.2.11.3-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/al_premul_rgba_f"
---

# al\_premul\_rgba\_f(3)

Allegro 5 API

## NAME

al\_premul\_rgba\_f - Allegro 5 API

## SYNOPSIS

-

  ```
  #include <allegro5/allegro.h>
  ALLEGRO_COLOR al_premul_rgba_f(float r, float g, float b, float a)
  ```

## DESCRIPTION

This is a shortcut for [al\_map\_rgba\_f(3)](/al_map_rgba_f/3.md)(r \* a, g \* a, b \* a, a).

By default Allegro uses pre-multiplied alpha for transparent blending of bitmaps and primitives (see [al\_load\_bitmap\_flags(3)](/al_load_bitmap_flags/3.md) for a discussion of that feature). This means that if you want to tint a bitmap or primitive to be transparent you need to multiply the color components by the alpha components when you pass them to this function. For example:

-

  ```
  float r = 1;
  float g = 0;
  float b = 0;
  float a = 0.5;
  ALLEGRO_COLOR c = al_premul_rgba_f(r, g, b, a);
  /* Draw the bitmap tinted red and half-transparent. */
  al_draw_tinted_bitmap(bmp, c, 0, 0, 0);
  ```

This function can be called before Allegro is initialized.

## SINCE

5\.1.12

## SEE ALSO

[al\_map\_rgba\_f(3)](/al_map_rgba_f/3.md), [al\_premul\_rgba(3)](/al_premul_rgba/3.md)
