mirror of
https://github.com/shazow/ssh-chat.git
synced 2025-09-24 03:42:32 -04:00
Fixing zero division error for one color themes
This commit is contained in:
parent
a4671ac262
commit
f8795d0803
@ -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)]
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user