Closed FlameInTheDark closed 5 years ago
This code
dc := gg.NewContext(300, 400) grad := gg.NewLinearGradient(0, 400, 0, 0) grad.AddColorStop(0, color.RGBA{30, 30, 200, 0}) grad.AddColorStop(1, color.RGBA{30, 30, 200, 255}) dc.SetFillStyle(grad) dc.MoveTo(0, 0) dc.LineTo(400, 0) dc.LineTo(400, 300) dc.LineTo(0, 300) dc.ClosePath() dc.Fill()
draws this image
I found solution. If i use color.NRGBA{...} instead of color.RGBA{...} it works fine.
color.NRGBA{...}
color.RGBA{...}
This code
draws this image