blend - chung-leong/qb GitHub Wiki

blend - Perform alpha blending on two pixels

float[4] blend(float[4] $x, float[4] $y)

float[2] blend(float[2] $x, float[2] $y)

blend() blends two pixels together in accordance to value of their alpha channels. If y is fully opaque, the return value is y. If y is fully transparent, the return value is x.

Parameters:

x - The bottom pixel. It can be a four-element array or an array of four element arrays.

y - The top pixel. It can be a four-element array or an array of four element arrays.

Return Value:

A pixel resulting from blending x and y. If x or y is an array of arrays, then return value is also an array of arrays, the size of which match the largest of the two.

Version

1.3 and above.