update colorizer

mine
derailed 2020-03-25 08:38:41 -06:00
parent 57260dfcb4
commit 2adafc0133
1 changed files with 7 additions and 1 deletions

View File

@ -3,6 +3,7 @@ package dao
import (
"bytes"
"fmt"
"math/rand"
"regexp"
"strings"
"time"
@ -91,7 +92,12 @@ func colorFor(n string) int {
for _, r := range n {
sum += int(r)
}
return sum % 256
c := sum % 256
if c == 0 {
c = 207 + rand.Intn(10)
}
return c
}
// ----------------------------------------------------------------------------