gg icon indicating copy to clipboard operation
gg copied to clipboard

drawing lines without gradiant

Open frranck opened this issue 5 years ago • 0 comments

Hello Michael, I'm trying to draw colored polygons but I would need their lines not to have any gradient and only use the color I'm filling them with. Any idea how I could do that? Thanks

	dc := gg.NewContext(160, 200)
	for _, p := range pixels {
		dc.Push()
		dc.MoveTo(p.x1, p.y1)
		dc.LineTo(p.x2, p.y2)
		dc.LineTo(p.x3, p.y3)
		dc.LineTo(p.x4, p.y4)
		dc.ClosePath()
		r, g, b := cp(p.pixelNumber)
		dc.SetRGB255(r, g, b)
		dc.SetLineWidth(1)
		dc.Fill()
		dc.Pop()
		dc.Stroke()
	}

frranck avatar Aug 01 '20 13:08 frranck