mirror of
https://github.com/D-Modem/brand.git
synced 2026-11-28 17:58:05 -08:00
Add the app launcher icon
The front of an RJ11 jack striped in the Rainbow Book colours, with the white carrier inside, on Android's 108-unit adaptive icon canvas, plus a 512px Play Store icon. tools/app_icon.py generates both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B82eRVHnHRzok8eDG2idnz
This commit is contained in:
7 files changed
+57
-2
No files matched your search
@@ -16,6 +16,7 @@ constellation.
|
||||
| `avatar/org-avatar.png` (500px), `@2x` (1000px) | GitHub org profile picture |
|
||||
| `avatar/mark.svg`, `mark.png`, `mark@2x.png` | Transparent mark for READMEs and docs |
|
||||
| `social/<repo>.png` (1280×640) | GitHub social preview for each repo |
|
||||
| `app-icon/ic_launcher.svg`, `play-store.png` (512px) | Android app launcher icon and Play Store icon |
|
||||
|
||||
## Palette
|
||||
|
||||
@@ -39,6 +40,15 @@ Neutrals: background `#0a0f1c`, panel `#121a2e`, text `#e8f0ff`, muted
|
||||
`#7f8bab`. Type: Sauce Code Pro, the [Nerd Fonts](https://www.nerdfonts.com/) build of
|
||||
[Source Code Pro](https://github.com/adobe-fonts/source-code-pro).
|
||||
|
||||
## App icon
|
||||
|
||||
<img src="app-icon/play-store.png" width="160" alt="D-Modem app icon">
|
||||
|
||||
The front of an RJ11 jack, its outline striped in the Rainbow Book colours
|
||||
like the mark, with the white carrier inside. It is drawn on Android's
|
||||
108-unit adaptive icon canvas; the app's `ic_launcher_foreground` and
|
||||
`ic_launcher_monochrome` vector drawables follow `tools/app_icon.py`.
|
||||
|
||||
## Previews
|
||||
|
||||
| | |
|
||||
@@ -65,4 +75,5 @@ intended; the SVGs name it as their font, so viewers without it fall back to
|
||||
another monospace font.
|
||||
|
||||
python3 tools/gen.py
|
||||
python3 tools/app_icon.py
|
||||
node tools/render.js
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 5.0 KiB |
@@ -0,0 +1,6 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="432" height="432" viewBox="0 0 108 108">
|
||||
<defs><linearGradient id="stripes" x1="0" y1="0" x2="0" y2="1"><stop offset="0.0000" stop-color="#ff4d5e"/><stop offset="0.1667" stop-color="#ff4d5e"/><stop offset="0.1667" stop-color="#ff8a3d"/><stop offset="0.3333" stop-color="#ff8a3d"/><stop offset="0.3333" stop-color="#ffd23d"/><stop offset="0.5000" stop-color="#ffd23d"/><stop offset="0.5000" stop-color="#3ddc84"/><stop offset="0.6667" stop-color="#3ddc84"/><stop offset="0.6667" stop-color="#3d8bff"/><stop offset="0.8333" stop-color="#3d8bff"/><stop offset="0.8333" stop-color="#a66bff"/><stop offset="1.0000" stop-color="#a66bff"/></linearGradient></defs>
|
||||
<rect x="-10" y="-10" width="128" height="128" fill="#0a0f1c"/>
|
||||
<path d="M34,34 H74 V66 H62.0 V75.6 H46.0 V66 H34 Z" fill="none" stroke="url(#stripes)" stroke-width="3.4"/>
|
||||
<path d="M39.0,50.0 L39.1,49.6 L39.2,49.2 L39.4,48.8 L39.5,48.4 L39.6,48.1 L39.8,47.7 L39.9,47.3 L40.0,47.0 L40.1,46.7 L40.2,46.3 L40.4,46.0 L40.5,45.8 L40.6,45.5 L40.8,45.2 L40.9,45.0 L41.0,44.8 L41.1,44.6 L41.2,44.5 L41.4,44.3 L41.5,44.2 L41.6,44.1 L41.8,44.1 L41.9,44.0 L42.0,44.0 L42.1,44.0 L42.2,44.1 L42.4,44.1 L42.5,44.2 L42.6,44.3 L42.8,44.5 L42.9,44.6 L43.0,44.8 L43.1,45.0 L43.2,45.2 L43.4,45.5 L43.5,45.8 L43.6,46.0 L43.8,46.3 L43.9,46.7 L44.0,47.0 L44.1,47.3 L44.2,47.7 L44.4,48.1 L44.5,48.4 L44.6,48.8 L44.8,49.2 L44.9,49.6 L45.0,50.0 L45.1,50.4 L45.2,50.8 L45.4,51.2 L45.5,51.6 L45.6,51.9 L45.8,52.3 L45.9,52.7 L46.0,53.0 L46.1,53.3 L46.2,53.7 L46.4,54.0 L46.5,54.2 L46.6,54.5 L46.8,54.8 L46.9,55.0 L47.0,55.2 L47.1,55.4 L47.2,55.5 L47.4,55.7 L47.5,55.8 L47.6,55.9 L47.8,55.9 L47.9,56.0 L48.0,56.0 L48.1,56.0 L48.2,55.9 L48.4,55.9 L48.5,55.8 L48.6,55.7 L48.8,55.5 L48.9,55.4 L49.0,55.2 L49.1,55.0 L49.2,54.8 L49.4,54.5 L49.5,54.2 L49.6,54.0 L49.8,53.7 L49.9,53.3 L50.0,53.0 L50.1,52.7 L50.2,52.3 L50.4,51.9 L50.5,51.6 L50.6,51.2 L50.8,50.8 L50.9,50.4 L51.0,50.0 L51.1,49.6 L51.2,49.2 L51.4,48.8 L51.5,48.4 L51.6,48.1 L51.8,47.7 L51.9,47.3 L52.0,47.0 L52.1,46.7 L52.2,46.3 L52.4,46.0 L52.5,45.8 L52.6,45.5 L52.8,45.2 L52.9,45.0 L53.0,44.8 L53.1,44.6 L53.2,44.5 L53.4,44.3 L53.5,44.2 L53.6,44.1 L53.8,44.1 L53.9,44.0 L54.0,44.0 H57.0 V56.0 H63.0 V44.0 H69.0" fill="none" stroke="#e8f0ff" stroke-width="3.4" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 8.3 KiB |
@@ -0,0 +1,6 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="18 18 72 72">
|
||||
<defs><linearGradient id="stripes" x1="0" y1="0" x2="0" y2="1"><stop offset="0.0000" stop-color="#ff4d5e"/><stop offset="0.1667" stop-color="#ff4d5e"/><stop offset="0.1667" stop-color="#ff8a3d"/><stop offset="0.3333" stop-color="#ff8a3d"/><stop offset="0.3333" stop-color="#ffd23d"/><stop offset="0.5000" stop-color="#ffd23d"/><stop offset="0.5000" stop-color="#3ddc84"/><stop offset="0.6667" stop-color="#3ddc84"/><stop offset="0.6667" stop-color="#3d8bff"/><stop offset="0.8333" stop-color="#3d8bff"/><stop offset="0.8333" stop-color="#a66bff"/><stop offset="1.0000" stop-color="#a66bff"/></linearGradient></defs>
|
||||
<rect x="-10" y="-10" width="128" height="128" fill="#0a0f1c"/>
|
||||
<path d="M34,34 H74 V66 H62.0 V75.6 H46.0 V66 H34 Z" fill="none" stroke="url(#stripes)" stroke-width="3.4"/>
|
||||
<path d="M39.0,50.0 L39.1,49.6 L39.2,49.2 L39.4,48.8 L39.5,48.4 L39.6,48.1 L39.8,47.7 L39.9,47.3 L40.0,47.0 L40.1,46.7 L40.2,46.3 L40.4,46.0 L40.5,45.8 L40.6,45.5 L40.8,45.2 L40.9,45.0 L41.0,44.8 L41.1,44.6 L41.2,44.5 L41.4,44.3 L41.5,44.2 L41.6,44.1 L41.8,44.1 L41.9,44.0 L42.0,44.0 L42.1,44.0 L42.2,44.1 L42.4,44.1 L42.5,44.2 L42.6,44.3 L42.8,44.5 L42.9,44.6 L43.0,44.8 L43.1,45.0 L43.2,45.2 L43.4,45.5 L43.5,45.8 L43.6,46.0 L43.8,46.3 L43.9,46.7 L44.0,47.0 L44.1,47.3 L44.2,47.7 L44.4,48.1 L44.5,48.4 L44.6,48.8 L44.8,49.2 L44.9,49.6 L45.0,50.0 L45.1,50.4 L45.2,50.8 L45.4,51.2 L45.5,51.6 L45.6,51.9 L45.8,52.3 L45.9,52.7 L46.0,53.0 L46.1,53.3 L46.2,53.7 L46.4,54.0 L46.5,54.2 L46.6,54.5 L46.8,54.8 L46.9,55.0 L47.0,55.2 L47.1,55.4 L47.2,55.5 L47.4,55.7 L47.5,55.8 L47.6,55.9 L47.8,55.9 L47.9,56.0 L48.0,56.0 L48.1,56.0 L48.2,55.9 L48.4,55.9 L48.5,55.8 L48.6,55.7 L48.8,55.5 L48.9,55.4 L49.0,55.2 L49.1,55.0 L49.2,54.8 L49.4,54.5 L49.5,54.2 L49.6,54.0 L49.8,53.7 L49.9,53.3 L50.0,53.0 L50.1,52.7 L50.2,52.3 L50.4,51.9 L50.5,51.6 L50.6,51.2 L50.8,50.8 L50.9,50.4 L51.0,50.0 L51.1,49.6 L51.2,49.2 L51.4,48.8 L51.5,48.4 L51.6,48.1 L51.8,47.7 L51.9,47.3 L52.0,47.0 L52.1,46.7 L52.2,46.3 L52.4,46.0 L52.5,45.8 L52.6,45.5 L52.8,45.2 L52.9,45.0 L53.0,44.8 L53.1,44.6 L53.2,44.5 L53.4,44.3 L53.5,44.2 L53.6,44.1 L53.8,44.1 L53.9,44.0 L54.0,44.0 H57.0 V56.0 H63.0 V44.0 H69.0" fill="none" stroke="#e8f0ff" stroke-width="3.4" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.3 KiB |
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env python3
|
||||
"""The app's launcher icon: an RJ11 jack striped in the Rainbow Book colours, the white carrier inside.
|
||||
Drawn on Android's 108-unit adaptive icon canvas (launchers show the middle 72, keep art within 21..87)."""
|
||||
import os
|
||||
from gen import ROOT, BOOKS, BG, INK, wave_path
|
||||
|
||||
X, Y, W, H = 34, 34, 40, 32 # the jack opening; the latch notch hangs below it
|
||||
|
||||
|
||||
def jack_d():
|
||||
nx, nh, cx = W * 0.4, H * 0.3, X + W / 2
|
||||
return f"M{X},{Y} H{X + W} V{Y + H} H{cx + nx / 2} V{Y + H + nh} H{cx - nx / 2} V{Y + H} H{X} Z"
|
||||
|
||||
|
||||
def icon(size=432, view="0 0 108 108"):
|
||||
stops = "".join(f'<stop offset="{i / 6:.4f}" stop-color="{c}"/><stop offset="{(i + 1) / 6:.4f}" stop-color="{c}"/>'
|
||||
for i, (_, _, c) in enumerate(BOOKS))
|
||||
return f'''<svg xmlns="http://www.w3.org/2000/svg" width="{size}" height="{size}" viewBox="{view}">
|
||||
<defs><linearGradient id="stripes" x1="0" y1="0" x2="0" y2="1">{stops}</linearGradient></defs>
|
||||
<rect x="-10" y="-10" width="128" height="128" fill="{BG}"/>
|
||||
<path d="{jack_d()}" fill="none" stroke="url(#stripes)" stroke-width="3.4"/>
|
||||
<path d="{wave_path(39, 69, 50, 6, 2.5, 0.5)}" fill="none" stroke="{INK}" stroke-width="3.4" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>'''
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
os.makedirs(os.path.join(ROOT, "app-icon"), exist_ok=True)
|
||||
with open(os.path.join(ROOT, "app-icon", "ic_launcher.svg"), "w") as f:
|
||||
f.write(icon() + "\n")
|
||||
# Play Store listing icon: 512px of the 72 units a launcher shows (Play applies its own mask)
|
||||
with open(os.path.join(ROOT, "app-icon", "play-store.svg"), "w") as f:
|
||||
f.write(icon(512, "18 18 72 72") + "\n")
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
// Renders avatar/*.svg and social/*.svg to PNGs next to them, using Playwright's Chromium.
|
||||
// Renders avatar/*.svg, social/*.svg and app-icon/*.svg to PNGs next to them, using Playwright's Chromium.
|
||||
// The avatar also gets a 2x (1000px) export. Needs Sauce Code Pro (Nerd Font Mono) installed for the text.
|
||||
const { chromium } = require('playwright');
|
||||
const fs = require('fs'), path = require('path');
|
||||
@@ -6,7 +6,7 @@ const root = path.join(__dirname, '..');
|
||||
|
||||
(async () => {
|
||||
const browser = await chromium.launch();
|
||||
for (const dir of ['avatar', 'social']) {
|
||||
for (const dir of ['avatar', 'social', 'app-icon']) {
|
||||
for (const f of fs.readdirSync(path.join(root, dir)).filter(f => f.endsWith('.svg'))) {
|
||||
const svg = fs.readFileSync(path.join(root, dir, f), 'utf8');
|
||||
const [, w, h] = svg.match(/width="(\d+)" height="(\d+)"/);
|
||||
|
||||
Reference in new issue
Block a user