Allow solid colored glyphs have a different colored outline
Created by: zaddok
Here is an initial go at a patch that allows solid coloured Glyphs to have an outline.
A keen observer may note that an update to allow a PyramidGlyph
to be solid coloured with an outline, is almost the same as if we had allowed TriangleGlyph
to have a fill. (ditto for Box/Square, and Circle,Round).
There is probably a case for arguing that we don't need PyramidGlyph
and TriangleGlyph
as they are both the same except with a different fill or stroke colour, but I don't want such arguments to hold up a useful patch :D Can we patch first and argue how to present the API later?
Where in the past we may have done:
p, err := plot.New()
....
lpPoints.Shape = draw.CircleGlyph{}
lpPoints.Color = color.RGBA{R: 255, G: 200, B: 200, A: 255}
p.Add(lpLine, lpPoints)
We can now do:
p, err := plot.New()
....
lpPoints.Shape = draw.CircleGlyph{}
lpPoints.Color = color.RGBA{R: 255, G: 200, B: 200, A: 255}
lpPoints.Width = vg.Points(1.0)
lpPoints.LineColor = lpLine.Color
p.Add(lpLine, lpPoints)