Files
fn_registry/functions/tui/load_ascii_art.md
T
egutierrez 47fac22230 chore: auto-commit (799 archivos)
- .claude/CLAUDE.md
- .claude/commands/subagentes.md
- .claude/rules/INDEX.md
- .mcp.json
- bash/functions/cybersecurity/analyze_dns.md
- bash/functions/cybersecurity/audit_http_headers.md
- bash/functions/cybersecurity/audit_ssh_config.md
- bash/functions/cybersecurity/check_firewall.md
- bash/functions/cybersecurity/detect_suspicious_users.md
- bash/functions/cybersecurity/encrypt_file.md
- ...

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 00:28:20 +02:00

1.8 KiB

name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, params, output, tested, tests, test_file_path, file_path, source_repo, source_license, source_file
name kind lang domain version purity signature description tags uses_functions uses_types returns returns_optional error_type imports params output tested tests test_file_path file_path source_repo source_license source_file
load_ascii_art function go tui 1.0.0 impure func LoadASCIIArt(staticPath string, colors []lipgloss.Color) string Lee un archivo .txt aleatorio de un directorio y lo renderiza con degradado de colores. Util para headers de TUIs con ASCII art variado.
tui
ascii
art
header
gradient
random
file
pendiente-usar
apply_gradient_go_tui
false error_go_core
bufio
math/rand
os
path/filepath
strings
time
github.com/charmbracelet/lipgloss
name desc
staticPath directorio con archivos .txt de ASCII art
name desc
colors paleta de colores para el degradado; nil usa DefaultGradientColors
string con ASCII art coloreado, o vacio si no hay archivos o hay error false
functions/tui/load_ascii_art.go https://gitea-dgg044oo04woo4ggcsws4gk0.organic-machine.com/egutierrez/DevLauncher.git MIT launcher/middleware/assets.go

Ejemplo

// Cada app pone sus archivos .txt en un directorio static/
header := tui.LoadASCIIArt("./static", nil)
if header != "" {
    fmt.Print(header)
}

// Con paleta custom
palette := []lipgloss.Color{
    lipgloss.Color("#ff6b6b"),
    lipgloss.Color("#feca57"),
    lipgloss.Color("#48dbfb"),
}
header = tui.LoadASCIIArt("./static", palette)

Notas

Patron de uso: cada app TUI mantiene un directorio static/ con archivos .txt de ASCII art. Al iniciar, LoadASCIIArt elige uno al azar y le aplica el degradado de colores. Esto da variedad visual en cada ejecucion.

Fallback silencioso: si el directorio no existe, no tiene .txt, o hay error de lectura, retorna "" sin error. El caller decide si mostrar un fallback.