We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c049ac6 commit e16a500Copy full SHA for e16a500
internal/ui/styles.go
@@ -140,7 +140,7 @@ var (
140
h.Write([]byte(str))
141
hash := h.Sum32()
142
143
- color := taskColors[int(hash)%len(taskColors)]
+ color := taskColors[hash%uint32(len(taskColors))]
144
return lipgloss.NewStyle().
145
Foreground(lipgloss.Color(color))
146
}
internal/ui/styles_test.go
@@ -0,0 +1,15 @@
1
+package ui
2
+
3
+import (
4
+ "testing"
5
6
+ "github.com/stretchr/testify/assert"
7
+)
8
9
+func TestGetDynamicStyle(t *testing.T) {
10
+ input := "abcdefghi"
11
+ gota := getDynamicStyle(input)
12
+ gotb := getDynamicStyle(input)
13
+ // assert same style returned for the same string
14
+ assert.Equal(t, gota.GetForeground(), gotb.GetForeground())
15
+}
0 commit comments