HomeMenu
Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

imagecolordeallocate

Description

The imagecolordeallocate of Image for PHP de-allocate a color for an image.

Syntax

imagecolordeallocate(
    GdImage $image,
    int $color
): bool

Parameters

image

A GdImage object, returned by one of the image creation functions, such as imagecreatetruecolor().

color

The color identifier.

Return

Returns true on success or false on failure.

Examples

1 · return

<?

$width = 100;
$height = 100;
$image = imagecreatetruecolor($width, $height);

$red = 255;
$green = 255;
$blue = 255;
$color = imagecolorallocate($image, $red, $green, $blue);

$return = imagecolordeallocate($image, $color);

var_export($return);
true