---
name: "set_color"
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_color/3alleg4"
---

# set\_color(3alleg4)

Sets the specified palette entry to the specified RGB triplet. Allegro game programming library.

## NAME

set\_color - Sets the specified palette entry to the specified RGB triplet. Allegro game programming library.

## SYNOPSIS

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

**void set\_color(int index, const RGB \*p);**

## DESCRIPTION

Sets the specified palette entry to the specified RGB triplet. Unlike the  other palette functions this doesn't do any retrace synchronisation, so  you should call vsync() before it to prevent snow problems. Example:

```
   RGB rgb;
   ...
   vsync();
   set_color(192, &rgb);
```

## SEE ALSO

**set\_palette**(3alleg4), **get\_color**(3alleg4), **\_set\_color**(3alleg4), **ex12bit**(3alleg4), **exrgbhsv**(3alleg4), **exscroll**(3alleg4)
