Php Imagecolorresolvealpha
# PHP imagecolorresolvealpha - Get the index value of a specified color with alpha or the closest possible alternative
[PHP Image Processing](#)
imagecolorresolvealpha β Get the index value of a specified color with alpha or the closest possible alternative.
### Syntax
int imagecolorresolvealpha ( resource $image , int $red , int $green , int $blue , int $alpha )
This function guarantees to return a color index for the requested color, either the exact value or the closest possible alternative.
**Note:** This function requires GD 2.0.1 or later (recommended version 2.0.28 and later).
### Parameters
* **image** An image resource returned by an image creation function (e.g., imagecreatetruecolor()).
* **red** The value of the red component.
* **green** The value of the green component.
* **blue** The value of the blue component.
* **alpha** A value between 0 and 127. 0 indicates completely opaque, 127 indicates completely transparent.
The color parameters are integers between 0 and 255, or hexadecimal numbers between 0x00 and 0xFF.
### Return Value
Returns a color index.
### Example
Get a color from the logo.
The output of the above example is similar to:
Array( => 16777215 => 2130706632)
### Related Articles
Get the color closest to the specified color with alpha.
[PHP Image Processing](#)
YouTip