Fix color.Premultiply
This commit is contained in:
parent
f647b544e2
commit
6bfa97e6aa
@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user