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.
- Service
Mark - A service’s mark, ready to draw.
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§
- app_
glyph - The glyph for the package
package_id(so.tilo.notes, or a local build’sdev.tilo.notes) in menu categorycategory, if it has one. - 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. - icon_
svg iconas an app’s icon artwork: the glyph stroked in white on a rounded tile of the accent gradient, as a standalone SVG document. A package that names a platform glyph as its icon (a tilolang app’sicon: .note) ships this as its signed icon file, so the launcher grid, search and the window chrome show the same artwork as any app with its own.- paint_
tilo_ mark - Paint the mark centred in
rect, its view box the largest square that fits. A dark ground (dark) takes the brand’s dark variant (mark-dark.svg): the light one’s pale bars glare there. - service_
mark - The mark of
service(its lowercase id,discord), if the toolkit knows one; a service without one is named in words instead.