Operating systems, development tools, and professional services
for connected embedded systems
for connected embedded systems
![]() |
![]() |
![]() |
![]() |
PgColorMatch()
Query for best color matches
Synopsis:
int PgColorMatch(int n,
PgColor_t const *in,
PgColor_t *out);
Arguments:
- n
- The number of colors in the array to find a match for.
- in
- An array of PgColor_t objects that specifies the colors that you want to match.
- out
- An array of PgColor_t objects that the function fills with the best color matches for the corresponding entry in the in array.
Library:
ph
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 |
See also:
"Color" in the Raw Drawing and Animation chapter of the Photon Programmer's Guide
![]() |
![]() |
![]() |
![]() |

![[Previous]](../prev.gif)
![[Contents]](../contents.gif)
![[Index]](../keyword_index.gif)
![[Next]](../next.gif)