Fix potential negative index when getting color from name
This commit is contained in:
		@@ -60,8 +60,8 @@ func GetHashColorName(s string) string {
 | 
				
			|||||||
		return "yellow"
 | 
							return "yellow"
 | 
				
			||||||
	default:
 | 
						default:
 | 
				
			||||||
		h := fnv.New32a()
 | 
							h := fnv.New32a()
 | 
				
			||||||
		h.Write([]byte(s))
 | 
							_, _ = h.Write([]byte(s))
 | 
				
			||||||
		return colorNames[int(h.Sum32())%len(colorNames)]
 | 
							return colorNames[h.Sum32()%uint32(len(colorNames))]
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user