a03675113a
- .claude/agents/fn-orquestador/SKILL.md - .claude/commands/fn_claude.md - .claude/rules/INDEX.md - .claude/rules/cpp_apps.md - .claude/rules/ids_naming.md - CHANGELOG.md - apps/dag_engine/README.md - apps/dag_engine/api.go - apps/dag_engine/dags_migrated/example.yaml - apps/dag_engine/dags_migrated/example_lineage_tracking.yaml - ... Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4.1 KiB
4.1 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
| 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 | |||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| generate_app_icon | function | py | infra | 1.0.0 | impure | generate_app_icon(phosphor_icon_name: str, accent_hex: str, out_ico_path: str, *, weight: str = 'fill', sizes: list[int] = None, phosphor_root: str = None) -> str | Rasteriza un icono Phosphor SVG sobre un fondo redondeado del color accent y exporta un .ico multi-resolucion (default 16,24,32,48,64,128,256). Devuelve el path absoluto del .ico escrito. El glyph se renderiza en blanco al 70% del canvas sobre fondo con esquinas redondeadas al 16%. |
|
false | error_go_core |
|
|
Ruta absoluta (str) del archivo .ico generado y escrito a disco. | false | python/functions/infra/generate_app_icon.py |
Ejemplo
from infra import generate_app_icon
# Generar icono para una app C++ del registry
ico_path = generate_app_icon(
phosphor_icon_name="chart-bar",
accent_hex="#0ea5e9",
out_ico_path="apps/chart_demo/appicon.ico",
)
print(ico_path) # /home/lucas/fn_registry/apps/chart_demo/appicon.ico
# Desde la CLI directa para prueba rapida
import sys
sys.path.insert(0, "python/functions")
from infra import generate_app_icon
generate_app_icon("gauge", "#059669", "/tmp/registry_dashboard.ico")
# Generar iconos para todas las apps del registry con el script batch
python dev/gen_app_icons.py
Cuando usarla
Cuando una app C++ del registry necesita un .ico de Windows para distinguirse en el escritorio y taskbar. El macro add_imgui_app de cpp/CMakeLists.txt detecta <app_dir>/appicon.ico y lo enlaza al .exe via windres automaticamente en builds Windows. Ejecutar esta funcion antes de compilar en Windows o antes de fn run redeploy_cpp_app_windows <app>.
Gotchas
- Requiere
sources/phosphor-core/: el repo debe estar clonado. Si falta:git clone --depth=1 https://github.com/phosphor-icons/core.git sources/phosphor-coredesde la raiz del registry. La funcion lanzaFileNotFoundErrorcon el comando exacto si el SVG no existe. cairosvgyPillowen el venv: deben estar instalados enpython/.venv. Si faltan:cd python && uv pip install cairosvg pillow. Ya presentes en el venv por defecto del registry.- El
.icose sobreescribe sin warning: si ya existeappicon.icose reemplaza silenciosamente. Hacer backup si se necesita preservar la version anterior. - Re-build del
.exenecesario: Windows no refleja el icono nuevo hasta que se recompila el ejecutable. Tras generar el.icoejecutarfn run redeploy_cpp_app_windows <app>o compilar manualmente con CMake. - Solo formato
#RRGGBB:accent_hexdebe tener exactamente 6 digitos hex. Formatos con alpha o notacion corta#RGBlanzanValueError. - Peso "fill" por defecto: Phosphor "fill" tiene las formas mas solidas y visibles en tamanos pequeños (16x16). Para iconos lineales usar
weight="regular"pero verificar legibilidad a 16px.
Capability growth log
(sin cambios desde v1.0.0)