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

PHP imagecolorresolvealpha - Get the Index of the Specified Color Plus Transparency or the Closest Possible Alternative

PHP imagecolorresolvealpha - Get the Index of the Specified Color Plus Transparency or the Closest Possible Alternative

PHP Image ProcessingPHP Image Processing

imagecolorresolvealpha — Gets the index of the specified color plus transparency or the closest possible alternative.

Syntax



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

This function guarantees that a color index is returned for the requested color, either the exact value or the closest alternative obtainable.

**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 a color index.

Example

Get the color from the Runoob Tutorial logo.





The output of the example above is similar to:



Array

(

    [0] => 16777215

    [1] => 2130706632

)

Related Articles

PHP Image ProcessingPHP Image Processing