YouTip LogoYouTip

Php Imagecolorexactalpha

# PHP imagecolorexactalpha - Get the index value of a specified color with alpha transparency [![Image 3: PHP Image Processing](#)PHP Image Processing](#) imagecolorexactalpha β€” Get the index value of a specified color with alpha transparency. ### Syntax int imagecolorexactalpha ( resource $image , int $red , int $green , int $blue , int $alpha ) Returns the index value of the specified color with alpha transparency in the image palette. **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 the index value of the specified color with alpha transparency in the image palette. If the color is not in the image's palette, returns -1. ### Example Get colors from the logo. The output of the above example is similar to: Array( => 16711680 => 2130706432 => 939524095 => 342163252) ### Related Articles Get the color closest to the specified color with alpha transparency. [![Image 4: PHP Image Processing](#)PHP Image Processing](#)
← Php ImagecolorresolvePhp Imagecolorallocatealpha β†’