[Previous] [Contents] [Index] [Next]

PgColorMatch()

Query for best color matches

Synopsis:

int PgColorMatch(int n, 
                 PgColor_t const *in, 
                 PgColor_t *out);

Description:

This function queries the graphics driver for the best color matches for a number of color values. This is particularly useful with a palette-based graphics driver.

An array of n colors from the in array is passed to the driver, which selects the closest match for each color and returns these in the out array.

With a true or direct color driver, the color is returned unchanged. With a palette-based driver, the closest color is found by computing within a RGB color cube the Cartesian distance between the color and each palette entry, and selecting the closest entry of a similar intensity.

Returns:

0
Successful completion.
-1
An error occurred.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

[Previous] [Contents] [Index] [Next]