MCPcopy
hub / github.com/cli/cli / shaToColorFunc

Function shaToColorFunc

pkg/cmd/repo/garden/garden.go:464–483  ·  view source on GitHub ↗
(sha string)

Source from the content-addressed store, hash-verified

462}
463
464func shaToColorFunc(sha string) func(string) string {
465 return func(c string) string {
466 red, err := strconv.ParseInt(sha[0:2], 16, 64)
467 if err != nil {
468 panic(err)
469 }
470
471 green, err := strconv.ParseInt(sha[2:4], 16, 64)
472 if err != nil {
473 panic(err)
474 }
475
476 blue, err := strconv.ParseInt(sha[4:6], 16, 64)
477 if err != nil {
478 panic(err)
479 }
480
481 return fmt.Sprintf("\033[38;2;%d;%d;%dm%s\033[0m", red, green, blue, c)
482 }
483}
484
485func computeSeed(seed string) int64 {
486 lol := ""

Callers 1

getCommitsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected