MCPcopy Create free account
hub / github.com/diillson/chatcli / Colorize

Method Colorize

cli/agent/ui_renderer.go:248–250  ·  view source on GitHub ↗

Colorize aplica cores ANSI (exportada com C maiúsculo). O resultado passa por theme.Recolor para que os códigos básicos legados (ColorCyan, ColorYellow, …) adotem a hue do tema ativo sob o profile de cor atual — toda a UI re-tematiza sem alterar os call sites, e a saída fica limpa (sem ANSI) quando

(text string, color string)

Source from the content-addressed store, hash-verified

246// re-tematiza sem alterar os call sites, e a saída fica limpa (sem ANSI) quando
247// não há terminal colorido (pipe/CI).
248func (r *UIRenderer) Colorize(text string, color string) string {
249 return theme.Recolor(fmt.Sprintf("%s%s%s", color, text, ColorReset))
250}
251
252// ClearScreen limpa a tela (se permitido)
253func (r *UIRenderer) ClearScreen() {

Callers 15

handleCommandBlocksMethod · 0.95
StreamOutputMethod · 0.95
PrintPlanCompactMethod · 0.95
PrintPlanFullMethod · 0.95
PrintLastResultMethod · 0.95
PrintHeaderMethod · 0.95
PrintMenuMethod · 0.95
RenderModeBannerMethod · 0.95
PrintPromptMethod · 0.95
RenderToolCallMethod · 0.95

Calls 1

RecolorFunction · 0.92

Tested by 1