Home > PHP > Function > GD > imagecolorsforindex()

imagecolorsforindex()

imagecolorsforindex - Get the colors for an index

Syntax

array imagecolorsforindex (resource $image, int $index)

Arguments

  • image - An image resource, returned by one of the image creation functions, such as imagecreatetruecolor().
  • index - The color index.

Description

Gets the color for a specified index.

Version

PHP 4, 5

Return value

Returns an associative array with red, green, blue and alpha keys that contain the appropriate values for the specified color index.