---
name: "bitmap_mask_color"
section: "3alleg"
platform: "linux"
package: "liballegro-doc"
version: "2:4.2.2-2.2"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/bitmap_mask_color"
---

# bitmap\_mask\_color(3alleg)

Returns the mask color of the specified bitmap. Allegro game programming library.

## NAME

bitmap\_mask\_color - Returns the mask color of the specified bitmap. Allegro game programming library.

## SYNOPSIS

**#include \<allegro.h\>**

**int bitmap\_mask\_color(BITMAP \*bmp);**

## DESCRIPTION

Returns the mask color for the specified bitmap (the value which is  skipped when drawing sprites). For 256-color bitmaps this is zero, and  for truecolor bitmaps it is bright pink (maximum red and blue, zero green). A frequent use of this function is to clear a bitmap with the mask color so you can later use this bitmap with masked\_blit() or draw\_sprite() after drawing other stuff on it. Example:

```
   /* Replace mask color with another color. */
   for (y = 0; y h; y++)
      for (x = 0; x w; x++)
         if (getpixel(bmp, x, y) == bitmap_mask_color(bmp))
            putpixel(bmp, x, y, another_color);
```

## SEE ALSO

[**MASK\_COLOR\_8**(3alleg)](/MASK_COLOR_8/3alleg.md), [**set\_color\_depth**(3alleg)](/set_color_depth/3alleg.md), [**bitmap\_color\_depth**(3alleg)](/bitmap_color_depth/3alleg.md), [**ex3d**(3alleg)](/ex3d/3alleg.md), [**exmouse**(3alleg)](/exmouse/3alleg.md), [**expat**(3alleg)](/expat/3alleg.md)
