Merge pull request #28 from derekschaab/issue-25

Return alpha-premultiplied color in gradient interpolation
This commit is contained in:
Michael Fogleman 2018-02-12 10:03:43 -05:00 committed by GitHub
commit 363d282ef3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -189,7 +189,7 @@ func colorLerp(c0, c1 color.Color, t float64) color.Color {
r0, g0, b0, a0 := c0.RGBA() r0, g0, b0, a0 := c0.RGBA()
r1, g1, b1, a1 := c1.RGBA() r1, g1, b1, a1 := c1.RGBA()
return color.NRGBA{ return color.RGBA{
lerp(r0, r1, t), lerp(r0, r1, t),
lerp(g0, g1, t), lerp(g0, g1, t),
lerp(b0, b1, t), lerp(b0, b1, t),