From 2adafc01335c9c463e85866dc79f542ceee445b4 Mon Sep 17 00:00:00 2001 From: derailed Date: Wed, 25 Mar 2020 08:38:41 -0600 Subject: [PATCH] update colorizer --- internal/dao/log_item.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/dao/log_item.go b/internal/dao/log_item.go index af6e09d5..cde710dd 100644 --- a/internal/dao/log_item.go +++ b/internal/dao/log_item.go @@ -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 } // ----------------------------------------------------------------------------