Fixing zero division error for one color themes

This commit is contained in:
Steven Leibrock 2016-08-07 14:50:17 -04:00
parent a4671ac262
commit f8795d0803
No known key found for this signature in database
GPG Key ID: 8D3B79B4EF97D8BC

View File

@ -83,6 +83,9 @@ type Palette struct {
// Get a color by index, overflows are looped around.
func (p Palette) Get(i int) Style {
if p.size == 1 {
return p.colors[0]
}
return p.colors[i%(p.size-1)]
}