A value between 0 and 127.
0 indicates completely opaque while
127 indicates completely transparent.
The red, green
and blue parameters are integers
between 0 and 255 or hexadecimals between 0x00 and 0xFF.
Return Values
A color identifier or false if the allocation failed.
Warning
This function may
return Boolean false, but may also return a non-Boolean value which
evaluates to false. Please read the section on Booleans for more
information. Use the ===
operator for testing the return value of this
function.
Changelog
Version
Description
8.0.0
image expects a GdImage
instance now; previously, a valid gdresource was expected.
Examples
Example #1 Example of using imagecolorallocatealpha()
The above example will output
something similar to:
Example #2 Convert typical alpha values for use with imagecolorallocatealpha()
Usually alpha values of 0 designate fully transparent pixels,
and the alpha channel has 8 bits. To convert such alpha values to be compatible
with imagecolorallocatealpha(), some simple arithmetic is
sufficient: