imagecolorclosest — Gets the index value of the color closest to the specified color.
int imagecolorclosest ( resource $image , int $red , int $green , int $blue )
Returns the color in the image palette that is "closest" to the specified RGB value.
The "distance" between the specified color and each color in the palette is calculated by treating the RGB values as the coordinates of a point in three-dimensional space.
If an image is created from a file, only the colors used in the image will be resolved. Colors that only appear in the palette are not interpreted.
imagecolorexact() Gets the index value of the specified color.