imagecolorallocatealpha

Supported Versions: PHP 4 >= 4.3.2, PHP 5, PHP 7, PHP 8
Allocate a color for an image
imagecolorallocatealpha(¬†¬†¬†¬†GdImage $image,¬†¬†¬†¬†int $red,¬†¬†¬†¬†int $green,¬†¬†¬†¬†int $blue,¬†¬†¬†¬†int $alpha): int|false
        if (is_null($matte)) {

            
$matte imagecolorallocatealpha($resource255255255127);

        } else {

            
$matte $image->getDriver()->parseColor($matte)->getInt();

        }
        $transparent imagecolorallocatealpha($canvas->getCore(), 255255255127);

        
imagealphablending($canvas->getCore(), false); // do not blend / just overwrite

        
imagefilledrectangle($canvas->getCore(), $dst_x$dst_y$dst_x $src_w 1$dst_y $src_h 1$transparent);
        if ($transIndex != -1) {

            
$rgba imagecolorsforindex($modified$transIndex);

            
$transColor imagecolorallocatealpha($modified$rgba['red'], $rgba['green'], $rgba['blue'], 127);

            
imagefill($modified00$transColor);

            
imagecolortransparent($modified$transColor);

        } else {
        imagealphablending($canvasfalse);

        
$transparent imagecolorallocatealpha($canvas255255255127);

        
imagefilledrectangle($canvas00$width$height$transparent);

        
imagecolortransparent($canvas$transparent);

        
imagealphablending($canvastrue);
        $clone imagecreatetruecolor($width$height);

        
imagealphablending($clonefalse);

        
imagesavealpha($clonetrue);

        
$transparency imagecolorallocatealpha($clone000127);

        
imagefill($clone00$transparency);

        

        
imagecopy($clone$core0000$width$height);