.\" Generated by the Allegro makedoc utility .TH bestfit_color 3alleg4 "version 4.4.2" "Allegro" "Allegro manual" .SH NAME bestfit_color \- Finds a palette color fitting the requested RGB values. Allegro game programming library.\& .SH SYNOPSIS .B #include .sp .B int bestfit_color(const PALETTE pal, int r, int g, int b); .SH DESCRIPTION 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. .SH "RETURN VALUE" Returns the index of the palette for the closest match to the requested color. .SH SEE ALSO .BR makecol8 (3alleg4)