---
name: "set_palette"
section: "3alleg4"
platform: "linux"
package: "allegro4-doc"
version: "2:4.4.3.1-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/set_palette/3alleg4"
---

# set\_palette(3alleg4)

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**(3alleg4), **set\_palette\_range**(3alleg4), **set\_color**(3alleg4), **get\_palette**(3alleg4), **select\_palette**(3alleg4), **palette\_color**(3alleg4)
