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

# makecol15\_dither(3alleg4)

Calculates a dithered 15 or 16-bit RGB value. Allegro game programming library.

## NAME

makecol15\_dither, makecol16\_dither - Calculates a dithered 15 or 16-bit RGB value. Allegro game programming library.

## SYNOPSIS

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

**int makecol15\_dither(int r, int g, int b, int x, int y);**

**int makecol16\_dither(int r, int g, int b, int x, int y);**

## DESCRIPTION

Given both a color value and a pixel coordinate, calculate a dithered 15  or 16-bit RGB value. This can produce better results when reducing images  from truecolor to hicolor. In addition to calling these functions  directly, hicolor dithering can be automatically enabled when loading  graphics by calling the set\_color\_conversion() function, for example  set\_color\_conversion(COLORCONV\_REDUCE\_TRUE\_TO\_HI \| COLORCONV\_DITHER).

Example:

```
   int pixel1, pixel2;
   /* The following two color values MAY be different. */
   pixel1 = makecol16_dither(255, 192, 64, 0, 0);
   pixel2 = makecol16_dither(255, 192, 64, 1, 0);
```

## RETURN VALUE

Returns the RGB value dithered for the specified coordinate.

## SEE ALSO

**makecol**(3alleg4), **makecol8**(3alleg4), **set\_color\_conversion**(3alleg4)
