BlendAlphaMode

Available since LÖVE 0.10.0
This enum is not supported in earlier versions.

Different ways alpha affects color blending. See BlendMode and the BlendMode Formulas for additional notes.

Constants

alphamultiply
The alpha channel of what's drawn is multiplied with its RGB values. This is the default alpha mode.
premultiplied
The alpha channel of what's drawn is not multiplied with its RGB values ("premultiplied alpha blending"). This should generally be used when drawing a Canvas to the screen, for example, because the alpha values of the Canvas' texture had previously been multiplied with its RGB values when drawing content to the Canvas itself.

Notes

The "alphamultiply" constant does not affect the "multiply" BlendMode. Similarly, the "screen" BlendMode's math is only correct if the "premultiplied" alpha mode is used and the alpha of drawn objects has already been multiplied with its RGB values previously (possibly inside a shader.)

Several articles have been written about premultiplied alpha and when to use it:

See Also

Other Languages