gizak / termui

Golang terminal dashboard
MIT License
13.22k stars 786 forks source link

clone slices to loosen reference #324

Open bakito opened 1 year ago

bakito commented 1 year ago

I multiple plots are used as in the demo, the line colors can not be configured separately. The reason is that the color slice from the template StandardColors are reuses and handed over by reference.

When the color is changed in one plot, then the slice in the other plot is also changed, hence, all lines with the same index have the same color.

This PR clones the color and style slice to get rid of this reference allowing to have different colors in different graphs.