Fix color.Premultiply

This commit is contained in:
Sasha Koshka 2024-09-12 03:13:35 -04:00
parent f647b544e2
commit 6bfa97e6aa

View File

@ -22,9 +22,9 @@ func ToRGBA (c color.Color) color.RGBA {
// Premultiply applies alpha-premultiplication that colors must apply as per
// color.Color.RGBA. This is an intrinsically lossy proccess.
func Premultiply (ur, ug, ub, ua uint32) (r, g, b, a uint32) {
return (ur * a) / 0xFFFF,
(ug * a) / 0xFFFF,
(ub * a) / 0xFFFF,
return (ur * ua) / 0xFFFF,
(ug * ua) / 0xFFFF,
(ub * ua) / 0xFFFF,
ua
}