Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP imagecolorsforindex - Get the Color of a Certain Index

PHP imagecolorsforindex - Get the Color of a Certain Index

PHP Image ProcessingPHP Image Processing

imagecolorsforindex — Gets the color of a certain index.

Syntax



array imagecolorsforindex ( resource $image , int $index )

This function returns an associative array with the keys red, green, blue, and alpha, containing the corresponding values of the specified color index.

Example





The output of the example above is similar to:



Array

(

    [red] => 195

    [green] => 223

    [blue] => 165

    [alpha] => 64

)

Related Articles

PHP Image ProcessingPHP Image Processing