Module icons
Expand description
Lucide-icon glyphs, stroked to match the concept’s 1.5 px aesthetic.
Each Icon variant resolves to one or more BezPath subpaths
traced from upstream lucide-react (v0.546.0, ISC licensed) in the
lucide 24×24 viewBox, scaled at draw time. Icons are stroked, not
filled — draw_icon mirrors that. Deliberately just a data table +
one draw function — no trait hierarchy, icon-theme system, or
per-icon caching.
To add an icon: pull the __iconNode entries from
tilo-concept/node_modules/lucide-react/dist/esm/icons/<kebab>.js,
add a variant to Icon, and map it in icon_subpaths.
Structs§
- AppImage
- A shareable handle to an application’s artwork.
Enums§
- Icon
- Stable identifier for a lucide glyph. New entries map 1:1 to lucide
icon kebab names (e.g.
Icon::LayoutGrid→layout-grid).
Constants§
- LUCIDE_
DEFAULT_ STROKE_ PX - Lucide’s default stroke width (in viewBox units) — 2.0 maps to
1.5 px after the concept’s Tailwind tweaks, so we scale by 0.75
when translating viewBox stroke width to output pixels. Call sites
can still override via the
stroke_pxargument ofdraw_icon. - LUCIDE_
VIEWBOX - Lucide’s fixed viewBox. Every stored path assumes this coordinate
system;
draw_iconscales to the requested rect. - MAX_
DEVICE_ PX - The largest edge chrome asks a source to rasterise.
Traits§
- AppImage
Source - Where an
AppImage’s pixels come from.
Functions§
- device_
px - The device-pixel edge
rectcovers undertransform. - draw_
app_ image - Paint
imagefillingrect, rasterised for the device sizerectcovers. Returnsfalse, painting nothing, when the source has no pixels, so the caller can fall back to a glyph. - draw_
icon - Paint
iconstroked incolorintoscene, centred withinrect. The icon is scaled fromrect.size().min() / LUCIDE_VIEWBOXso it always fits the shorter dimension, padding the longer axis. - draw_
icon_ layered draw_iconwith a per-subpath colour. Exists for glyphs whose subpaths mean different things — the Wi-Fi arcs are a scale, not a picture, so a two-bar signal should paint two arcs lit and two dim rather than the whole glyph at one alpha (drawing four nested icons at four sizes would not line up; they must come from one path table).- icon_
for_ path - Map a filesystem entry to the most appropriate
Icon. Directories always resolve toIcon::Folder; files are classified by (lower-cased) extension, falling back toIcon::File.