// Shared SVG composition helpers for the brand render scripts. Compositions // are assembled at render time by nesting the canonical brand SVGs into a // paper-colored canvas, so derived art can never drift from the logo files. import { readFileSync } from 'node:fs' import { resolve } from 'node:path' export const PAPER = '#f4f3ee' /** Inline a brand SVG as a nested positioned inside a composition. */ export function nest(file, x, y, width, height = width) { return readFileSync(resolve(file), 'utf8') .replace('` } /** Wrap a tile body ({ width, height, body }) in a paper-colored canvas. */ export function compose(tile) { return ( `` + `` + tile.body() + '' ) }