Home > PHP > Function > GD > imagecolorallocate()

imagecolorallocate()

imagecolorallocate - Allocate a color for an image

Syntax

int imagecolorallocate (resource $image, int $red, int $green, int $blue)

Arguments

  • image - An image resource, returned by one of the image creation functions, such as imagecreatetruecolor().
  • red - Value of red component.
  • green - Value of green component.
  • blue - Value of blue component.

Description

Returns a color identifier representing the color composed of the given RGBcomponents.

Version

PHP 4, 5

Return value

A color identifier or FALSE if the allocation failed.