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

# set\_palette(3alleg)

Sets the entire palette of 256 colors. Allegro game programming library.

## NAME

set\_palette - Sets the entire palette of 256 colors. Allegro game programming library.

## SYNOPSIS

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

**void set\_palette(const PALETTE p);**

## DESCRIPTION

Sets the entire palette of 256 colors. You should provide an array of 256  RGB structures. Unlike set\_color(), there is no need to call vsync()  before this function. Example:

```
   BITMAP *bmp;
   PALETTE palette;
   ...
   bmp = load_bitmap(filename, palette);
   if (!bmp)
      abort_on_error("Couldn't load bitmap!");
   set_palette(palette);
```

## SEE ALSO

[**set\_gfx\_mode**(3alleg)](/set_gfx_mode/3alleg.md), [**set\_palette\_range**(3alleg)](/set_palette_range/3alleg.md), [**set\_color**(3alleg)](/set_color/3alleg.md), [**get\_palette**(3alleg)](/get_palette/3alleg.md), [**select\_palette**(3alleg)](/select_palette/3alleg.md), [**palette\_color**(3alleg)](/palette_color/3alleg.md)
