---
name: "color_map"
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/color_map"
---

# color\_map(3alleg)

Global pointer to the color mapping table. Allegro game programming library.

## NAME

color\_map - Global pointer to the color mapping table. Allegro game programming library.

## SYNOPSIS

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

**extern COLOR\_MAP \*color\_map;**

## DESCRIPTION

Global pointer to the color mapping table. You must allocate your own COLOR\_MAP either statically or dynamically and set color\_map to it  before using any translucent or lit drawing functions in a 256-color  video mode! Example:

```
   color_map = malloc(sizeof(COLOR_MAP));
   if (!color_map)
      abort_on_error("Not enough memory for color map!");
```

## SEE ALSO

[**create\_color\_table**(3alleg)](/create_color_table/3alleg.md), [**create\_light\_table**(3alleg)](/create_light_table/3alleg.md), [**create\_trans\_table**(3alleg)](/create_trans_table/3alleg.md), [**create\_blender\_table**(3alleg)](/create_blender_table/3alleg.md), [**set\_trans\_blender**(3alleg)](/set_trans_blender/3alleg.md), [**draw\_trans\_sprite**(3alleg)](/draw_trans_sprite/3alleg.md), [**draw\_lit\_sprite**(3alleg)](/draw_lit_sprite/3alleg.md), [**draw\_gouraud\_sprite**(3alleg)](/draw_gouraud_sprite/3alleg.md), [**drawing\_mode**(3alleg)](/drawing_mode/3alleg.md), [**ex3d**(3alleg)](/ex3d/3alleg.md), [**excolmap**(3alleg)](/excolmap/3alleg.md), [**exlights**(3alleg)](/exlights/3alleg.md), [**exshade**(3alleg)](/exshade/3alleg.md), [**extrans**(3alleg)](/extrans/3alleg.md)
