bestfit_color(3alleg)

bestfit_color3alleg

Finds a palette color fitting the requested rgb values. allegro game programming library.

Usage

#include <allegro.h>

int bestfit_color(const PALETTE pal, int r, int g, int b);

Overview

Searches the specified palette for the closest match to the requested color, which are specified in the VGA hardware 0-63 format. Normally you should call makecol8() instead, but this lower level function may be useful if you need to use a palette other than the currently selected one, or specifically don't want to use the rgb_map lookup table.

Return value

Returns the index of the palette for the closest match to the requested color.

Releases

4 releases since Debian 3.1 (Sarge); the text changed 2 times.

  1. 3.1
  2. 4.0
  3. 5.0–6.0

From liballegro-doc 2:4.2.2-2.2 in Debian 6.0 (Squeeze). Parsed by carta from the page's man source.