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