pickColor picks a color for key.
(key string)
| 198 | |
| 199 | // pickColor picks a color for key. |
| 200 | func pickColor(key string) int { |
| 201 | const numColors = 1048576 |
| 202 | h := sha256.Sum256([]byte(key)) |
| 203 | index := binary.LittleEndian.Uint32(h[:]) |
| 204 | return int(index % numColors) |
| 205 | } |
| 206 | |
| 207 | // Legend returns the list of lines to display as the legend. |
| 208 | func (s *StackSet) Legend() []string { |
no outgoing calls
no test coverage detected
searching dependent graphs…