Fix texmod.colorize crash if ratio is nil

This commit is contained in:
Lars Mueller 2023-05-27 17:21:41 +02:00
parent 73640f11d1
commit 5dc6307661

@ -297,7 +297,7 @@ function texmod:colorize(color, ratio)
if ratio == "alpha" then
assert(color.alpha or 0xFF == 0xFF)
else
ratio = ratio or color.alpha
ratio = ratio or color.alpha or 0xFF
assert_uint8(ratio)
if color.alpha == ratio then
ratio = nil