aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2019-01-12 00:44:32 +0200
committerTulir Asokan <tulir@maunium.net>2019-01-12 00:44:32 +0200
commitd624023ca376b27a467b1cd54c3992a7e1d862ab (patch)
tree78752ec899286d1f128bd70aa2c6e5ec4fef34be
parente539a9098ca02b8ca20862a4944e9afc477a7973 (diff)
Fix potential negative index when getting color from name
-rw-r--r--ui/widget/color.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/ui/widget/color.go b/ui/widget/color.go
index e2c2b68..37a931a 100644
--- a/ui/widget/color.go
+++ b/ui/widget/color.go
@@ -60,8 +60,8 @@ func GetHashColorName(s string) string {
return "yellow"
default:
h := fnv.New32a()
- h.Write([]byte(s))
- return colorNames[int(h.Sum32())%len(colorNames)]
+ _, _ = h.Write([]byte(s))
+ return colorNames[h.Sum32()%uint32(len(colorNames))]
}
}