8bc721d53b
7 funciones Go del dominio tui: apply_gradient (gradiente de color en texto), draw_box y draw_separator (renderizado de cajas y separadores con box_chars), load_ascii_art (carga de arte ASCII desde archivos), normalize_terminal_output y strip_ansi (limpieza de salida de terminal), read_dir_autocomplete (autocompletado de rutas de directorio). Incluye box_chars.go como helper de caracteres Unicode para bordes.
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.