mirror of
https://github.com/storytold/effectcraft.git
synced 2026-10-30 13:08:07 -06:00
Dither can round a colour byte up while alpha rounds down (colour = alpha = 100.25/255 gives alpha 100, colour 101), breaking the premultiplied invariant. Clamp each dithered colour byte to the written alpha byte. Test: dithered_premultiplied_colour_never_exceeds_alpha.