traits/image.php
final protected function _createImageColorAlpha(array $rgba = array())
	{
		$keys = array('r', 'g', 'b', 'a');
		$rgba = array_filter($rgba, 'is_int');
		$rgba = array_map('abs', $rgba);
		$rgba = array_pad($rgba, count($keys), 0);
		$rgba = array_slice($rgba, 0, count($keys));
		$rgba = array_combine($keys, $rgba);

		extract($rgba);

		return imagecolorallocatealpha(
			$this->_image_handle,
			min($r, 255),
			min($g, 255),
			min($b, 255),
			min($a, 127)
		);
	}
final protected function _createImageColorAlpha(array $rgba = array())
	{
		$keys = array('r', 'g', 'b', 'a');
		$rgba = array_filter($rgba, 'is_int');
		$rgba = array_map('abs', $rgba);
		$rgba = array_pad($rgba, count($keys), 0);
		$rgba = array_slice($rgba, 0, count($keys));
		$rgba = array_combine($keys, $rgba);

		extract($rgba);

		return imagecolorallocatealpha(
			$this->_image_handle,
			min($r, 255),
			min($g, 255),
			min($b, 255),
			min($a, 127)
		);
	}
final protected function _createImageColorAlpha ( array $ rgba = array ( ) ) { $ keys = array ( 'r' , 'g' , 'b' , 'a' ) ; $ rgba = array_filter ( $ rgba , 'is_int' ) ; $ rgba = array_map ( 'abs' , $ rgba ) ; $ rgba = array_pad ( $ rgba , count ( $ keys ) , 0 ) ; $ rgba = array_slice ( $ rgba , 0 , count ( $ keys ) ) ; $ rgba = array_combine ( $ keys , $ rgba ) ; extract ( $ rgba ) ; return imagecolorallocatealpha ( $ this -> _image_handle , min ( $ r , 255 ) , min ( $ g , 255 ) , min ( $ b , 255 ) , min ( $ a , 127 ) ) ; }
Allocate a color for an image

@param array $rgba RGBA array for color
@return int        A color identifier or FALSE if the allocation failed.
@see https://php.net/manual/en/function.imagecolorallocatealpha.php
Allocate a color for an image