1bestfit_color(3)                Allegro manual                bestfit_color(3)
2
3
4

NAME

6       bestfit_color - Finds a palette color fitting the requested RGB values.
7       Allegro game programming library.
8

SYNOPSIS

10       #include <allegro.h>
11
12
13       int bestfit_color(const PALETTE pal, int r, int g, int b);
14

DESCRIPTION

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

RETURN VALUE

24       Returns the index of the palette for the closest match to the requested
25       color.
26
27

SEE ALSO

29       makecol8(3)
30
31
32
33Allegro                          version 4.4.2                bestfit_color(3)
Impressum