BlendMode

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

How what is drawn is blended with what's already there.

The numbers in the formulas are in the interval [0,1]. The resulting color is clamped to [0,1] (except when rendering to HDR Canvases).

dst is the existing color.

src is the new color.

res is the resulting color.

Constants

additive
   res.rgba = dst.rgba + (src.rgba * src.a)
alpha
The default blend mode.
   res.rgb = dst.rgb * (1 - src.a) + src.rgb * src.a
   res.a = dst.a * (1 - src.a) + src.a
   Before 0.9.0:
   res.rgba = dst.rgba * (1 - src.a) + src.rgba * src.a
Available since LÖVE 0.7.0
These following choices are not supported in earlier versions.
subtractive
   res.rgba = dst.rgba - src.rgba * src.a
multiplicative
   res.r = src.r * dst.r
   Before 0.9.0:
   res.rgba = dst.rgba * (1 - src.a) + src.rgba * dst.rgba
Available since LÖVE 0.8.0
This following choice is not supported in earlier versions.
premultiplied
   res.rgba = dst.rgba * (1 - src.a) + src.rgba
Available since LÖVE 0.9.0
This following choice is not supported in earlier versions.
replace
   res.rgba = src.rgba

See Also

Other Languages