Expand description
Theme asset resolution: wallpapers, lockscreens, branding logos, app icons, launcher icon, and the SVG rasterisation pipeline (with process-wide cache) that the canvas consumes.
Functions§
- Path to
app-default.svginside the active theme’s icon directory. ReturnsNonewhen the document has no on-disk root or the file is absent. - Path to the named app icon SVG inside the active theme’s
icons/apps/directory.nameis the bare stem (e.g."firefox","calculator") without the.svgextension. ReturnsNonewhen the active document has no on-disk root or the file does not exist. - Resolve a branding asset (launcher logo, wallpaper, lockscreen, …) against the active theme’s
branding/tree. Tries three candidate paths in order and returns the first one that exists on disk: - Resolve a branded image asset, preferring a raster variant (WebP / PNG / JPEG) over the canonical SVG. Tries [
branding_raster(name, sw, sh)] first; onNone(no raster files at all underbranding/{mode}/{name}/) falls back to [branding_asset(name, "svg")]. - Resolve a raster variant of a branded asset for the given surface dimensions. Looks under
branding/{mode}/{name}/(with the standard mode → opposite-mode → no-mode fallback chain on the directory), parses each filename asWIDTHxHEIGHT.<ext>where<ext>iswebp,png,jpg, orjpeg. Returns the best match in the first existing directory: - Decode a UTF-8 SVG document into a premultiplied RGBA8 pixmap of the requested longest-edge
sizein physical pixels. The shorter edge is scaled proportionally so the icon’s aspect ratio is preserved; the returned(width, height)reflect the final pixmap. - Resolve a theme-relative icon name to an absolute path inside the active theme’s
icons/catalogue/tree. - Rasterise a theme icon to a premultiplied RGBA8 pixmap.
- Path to the launcher-logo SVG for the currently active mode. Resolves through
branding_assetusing the conventionbranding/{mode}/launcher.svg, with the standard mode → opposite-mode → no-mode fallback chain. - The active mode’s lockscreen / greeter wallpaper. Same resolution strategy as
wallpaper: explicittheme.jsondeclaration first, otherwisebranding/{mode}/lockscreen.svgviabranding_asset. Usebranding_image( "lockscreen", sw, sh )for the size-aware raster lookup. - Path to the brand logo SVG for the currently active mode. Convention:
branding/{mode}/logo/logo.svg. The “main” logo — usually the wordmark variant a shell would put in an “About” dialog or a splash. Pair withlogo_square/logo_horizontalwhen the surface dictates a different aspect ratio. - Path to the horizontal (wordmark) brand logo SVG for the currently active mode. Convention:
branding/{mode}/logo/horizontal.svg. Use when there is meaningful horizontal space — header bars, menu bars, “About” dialogs, sign-in screens. Same fallback chain aslogo. - Path to the square (1:1) brand logo SVG for the currently active mode. Convention:
branding/{mode}/logo/square.svg. Use when the surface is roughly square — app icons, login avatars, splash screens, lockscreen brand badges. Same fallback chain aslogo. - Re-tint a symbolic RGBA icon: replace every pixel’s RGB with
tintwhile keeping the source alpha (weighted bytint.a). - The active mode’s homescreen / shell wallpaper. Prefers an explicit declaration in
theme.json; when absent, falls back to the convention pathbranding/{mode}/wallpaper.svgviabranding_asset(with mode → opposite-mode → no-mode fallback). ReturnsNonewhen neither source resolves to an existing file.