Files
gui/tools/icons.js
T
Claude 64b4bb595f Icons: D-Modem's mark instead of the app icon
assets/dmodem.svg is now the D of D-Modem/brand's avatar/org-avatar.svg
on the same dark tile, and tools/icons.js and icons.py made the Windows
.ico and the macOS AppIcon set from it. The Linux app installs the SVG.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRhKGCaYUyYtH7Boap
2026-11-20 21:42:58 +00:00

21 lines
1.0 KiB
JavaScript

// Renders assets/dmodem.svg (D-Modem/brand's mark, avatar/org-avatar.svg, on a tile) to the
// PNGs the apps' icons are made from, with Playwright's Chromium:
// node tools/icons.js && python3 tools/icons.py
const { chromium } = require('playwright');
const fs = require('fs'), path = require('path');
const root = path.join(__dirname, '..');
const svg = fs.readFileSync(path.join(root, 'assets', 'dmodem.svg'), 'utf8');
const out = path.join(root, 'build', 'icons');
fs.mkdirSync(out, { recursive: true });
(async () => {
const browser = await chromium.launch();
for (const size of [16, 32, 48, 64, 128, 256, 512, 1024]) {
const page = await browser.newPage({ viewport: { width: size, height: size } });
const s = svg.replace(/width="\d+" height="\d+"/, `width="${size}" height="${size}"`);
await page.setContent(`<html><body style="margin:0;background:transparent">${s}</body></html>`);
await page.screenshot({ path: path.join(out, `${size}.png`), omitBackground: true });
await page.close();
}
await browser.close();
})();