MCPcopy
hub / github.com/guptarohit/asciigraph / String

Method String

color.go:418–435  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

416}
417
418func (c AnsiColor) String() string {
419 if c == Default {
420 return "\x1b[0m"
421 }
422 if c == Black {
423 c = 0
424 }
425 if c <= Silver {
426 // 3-bit color
427 return fmt.Sprintf("\x1b[%dm", 30+byte(c))
428 }
429 if c <= White {
430 // 4-bit color
431 return fmt.Sprintf("\x1b[%dm", 82+byte(c))
432 }
433 // 8-bit color
434 return fmt.Sprintf("\x1b[38;5;%dm", byte(c))
435}

Callers 7

createLegendItemFunction · 0.80
PlotManyFunction · 0.80
addXAxisFunction · 0.80
captureStdoutFunction · 0.80

Calls

no outgoing calls