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 RGB values of what's drawn are multiplied by the alpha values of those colors during blending. This is the default alpha mode.
premultiplied
The RGB values of what's drawn are not multiplied by the alpha values of those colors during blending. For most blend modes to work correctly with this alpha mode, the colors of a drawn object need to have had their RGB values multiplied by their alpha values at some point previously ("premultiplied alpha").

Notes

The "premultiplied" constant should generally be used when drawing a Canvas to the screen, because the RGB values of the Canvas' texture had previously been multiplied by its alpha values when drawing content to the Canvas itself.

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