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

PHP imagecolorexactalpha - Get the Index of the Specified Color Plus Transparency

PHP imagecolorexactalpha - Get the Index of the Specified Color Plus Transparency

PHP Image ProcessingPHP Image Processing

imagecolorexactalpha — Gets the index value of the specified color plus transparency.

Syntax



int imagecolorexactalpha ( resource $image , int $red , int $green , int $blue , int $alpha )

Returns the index value of the specified color plus transparency in the image palette.

**Note:** This function requires GD 2.0.1 or higher (2.0.28 or higher recommended).

Parameters

The color parameter is an integer between 0 and 255, or a hexadecimal number between 0x00 and 0xFF.

Return Value

Returns the index value of the specified color plus transparency in the image palette. Returns -1 if the color is not in the image palette.

Example

Get the color from the Runoob Tutorial logo.





The output of the example above is similar to:



Array

(

    [0] => 16711680

    [1] => 2130706432

    [2] => 939524095

    [3] => 342163252

)

Related Articles

PHP Image ProcessingPHP Image Processing