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

# palette\_color(3alleg)

Maps palette indexes into the current pixel format colors. Allegro game programming library.

## NAME

palette\_color - Maps palette indexes into the current pixel format colors. Allegro game programming library.

## SYNOPSIS

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

**extern int palette\_color\[256\];**

## DESCRIPTION

Table mapping palette index colors (0-255) into whatever pixel format is  being used by the current display mode. In a 256-color mode this just  maps onto the array index. In truecolor modes it looks up the specified  entry in the current palette, and converts that RGB value into the  appropriate packed pixel format. Example:

```
   set_color_depth(32);
   ...
   set_palette(desktop_palette);
   /* Put a pixel with the color 2 (green) of the palette */
   putpixel(screen, 100, 100, palette_color[2]);
```

## SEE ALSO

[**set\_palette**(3alleg)](/set_palette/3alleg.md), [**makecol**(3alleg)](/makecol/3alleg.md), [**set\_color\_depth**(3alleg)](/set_color_depth/3alleg.md)
