logo
Free, Micro AI Code Reviews That Run on Git Commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, Micro AI Code Reviews That Run on Git Commit | Product Hunt git-lrc - Free, Micro AI Code Reviews That Run on Git Commit | Product Hunt

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

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.

Name

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

Return Value

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

See Also

makecol8(3alleg4)

Allegro                                           version 4.4.3                           bestfit_color(3alleg4)

Synopsis

#include<allegro.h>intbestfit_color(constPALETTEpal,intr,intg,intb);

See Also