47fac22230
- .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>
1.8 KiB
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. |
|
|
false | error_go_core |
|
|
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.