Feature Request: Easy way to cycle through colors
Created by: btracey
It's a very common desire to have the lines in a plot have different colors. This is not too difficult to accomplish if there are a small number of lines added in one place, but if there are a series of operations that each add to the plot (say, plot is passed along a channel to different cases) it's hard to write each module so that it can add a unique color without caring where it is in the chain.
The easiest design from the perspective of a user is that plot would have a "ColorIterator"
type ColorIterator interface {
NextColor() color.RGBA
}
This would then be embedded by plot and set to a default iterator with plot.New. A subroutine could then choose the color of a line (for example) with a call to p.NextColor().
I don't know if this is the best design with respect to the rest of the package, some design along those lines would be very nice.