diff --git a/modules/dcolor/core.go b/modules/dcolor/core.go index 4d47a4918..b06733338 100644 --- a/modules/dcolor/core.go +++ b/modules/dcolor/core.go @@ -38,10 +38,11 @@ func RandomColor(difficulty pb.DBDColorDifficulty, Repeat bool) (temcolors []pb. } if Repeat { for i := 0; i < colorNum; i++ { - n, _ := rand.Int(rand.Reader, big.NewInt(8)) + n, _ := rand.Int(rand.Reader, big.NewInt(int64(colorNum))) temcolors[i] = colors[n.Int64()] } } else { + colors = colors[0:colorNum] for i := 0; i < colorNum; i++ { n, _ := rand.Int(rand.Reader, big.NewInt(int64(len(colors)))) index := n.Int64()