New app icon: a pipeline graph instead of the P
One stage forks into two parallel stages that rejoin in a finished ring, in the app's palette on the dark background. Updates the Android adaptive, themed and legacy launcher icons, the status-bar icon, the iOS icon set and the web favicon and PWA icons, and adds the generator under tool/app_icon.
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
# App icon
|
||||
|
||||
The Pipelines mark: one stage forking into two parallel stages that rejoin in
|
||||
a finished (ring) stage, on the dark app background.
|
||||
|
||||
- `make_icon.py OUTDIR` writes the SVG variants (`rounded.svg` for web and
|
||||
legacy Android, `square.svg` for iOS, `maskable.svg` for the PWA) and the
|
||||
Android vectors (adaptive foreground, themed monochrome, status-bar icon).
|
||||
- `render.sh SVG SIZE OUT.png` renders an SVG with headless Chrome.
|
||||
|
||||
Regenerate the PNGs at the sizes listed in `web/`, `android/app/src/main/res/mipmap-*`
|
||||
and `ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json` (iOS icons
|
||||
are flattened onto the background: they must be opaque).
|
||||
@@ -0,0 +1,77 @@
|
||||
"""Generates the Pipelines mark as SVG variants and the Android vector drawables."""
|
||||
import sys, os
|
||||
OUT = sys.argv[1]
|
||||
|
||||
def graph(color=True, mono='#FFFFFF'):
|
||||
c = (lambda v: v) if color else (lambda v: mono)
|
||||
return f'''<g fill="none" stroke-width="3.6" stroke-linecap="round">
|
||||
<path d="M17 32 C24 32 24 21 31 21" stroke="{c('#8FA8FF')}"/>
|
||||
<path d="M17 32 C24 32 24 43 31 43" stroke="{c('#8FA8FF')}"/>
|
||||
<path d="M33 21 C39.5 21 39.5 32 43.6 32" stroke="{c('#5FD3B8')}"/>
|
||||
<path d="M33 43 C39.5 43 39.5 32 43.6 32" stroke="{c('#C59BFF')}"/>
|
||||
</g>
|
||||
<circle cx="15" cy="32" r="6" fill="{c('#8FA8FF')}"/>
|
||||
<circle cx="32" cy="21" r="5.2" fill="{c('#5FD3B8')}"/>
|
||||
<circle cx="32" cy="43" r="5.2" fill="{c('#C59BFF')}"/>
|
||||
<circle cx="49" cy="32" r="4.3" fill="none" stroke="{c('#7BE39B')}" stroke-width="3.4"/>'''
|
||||
|
||||
def svg(scale=1.12, rounded=True, background=True, color=True):
|
||||
bg = ''
|
||||
if background:
|
||||
rx = ' rx="14"' if rounded else ''
|
||||
bg = f'''<defs><linearGradient id="bg" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#1B1B24"/><stop offset="1" stop-color="#0E0E12"/></linearGradient></defs>
|
||||
<rect width="64" height="64"{rx} fill="url(#bg)"/>'''
|
||||
t = f'translate(32 32) scale({scale}) translate(-32 -32)'
|
||||
return f'''<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-label="Pipelines">
|
||||
{bg}
|
||||
<g transform="{t}">
|
||||
{graph(color)}
|
||||
</g>
|
||||
</svg>
|
||||
'''
|
||||
|
||||
variants = {
|
||||
'rounded.svg': svg(), # favicon, web icons, legacy Android
|
||||
'square.svg': svg(rounded=False), # iOS (the OS masks corners)
|
||||
'maskable.svg': svg(scale=0.92, rounded=False), # PWA maskable: inside the 80% safe circle
|
||||
}
|
||||
for name, body in variants.items():
|
||||
open(os.path.join(OUT, name), 'w').write(body)
|
||||
|
||||
# Android vectors share one path set. The 64-unit graph is placed in the 108dp
|
||||
# adaptive canvas inside the 66dp safe zone (scale 66/64*0.92 about the centre).
|
||||
def vector(color=True, size=108, scale=None, comment=''):
|
||||
s = scale if scale is not None else (66 / 64) * 1.12
|
||||
tx = size / 2 - 32 * s
|
||||
def col(v): return v if color else '#FFFFFFFF'
|
||||
def stroke(d, colr, w=3.6):
|
||||
return f''' <path android:pathData="{d}" android:fillColor="#00000000" android:strokeColor="{col(colr)}" android:strokeWidth="{w}" android:strokeLineCap="round"/>'''
|
||||
def dot(cx, cy, r, colr):
|
||||
d = f'M{cx - r},{cy}a{r},{r} 0,1 0,{2 * r},0a{r},{r} 0,1 0,{-2 * r},0'
|
||||
return f''' <path android:pathData="{d}" android:fillColor="{col(colr)}"/>'''
|
||||
ring = 'M49,32m-4.3,0a4.3,4.3 0,1 0,8.6,0a4.3,4.3 0,1 0,-8.6,0'
|
||||
return f'''<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- {comment} Generated from the Pipelines mark (64-unit grid). -->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="{size}dp"
|
||||
android:height="{size}dp"
|
||||
android:viewportWidth="{size}"
|
||||
android:viewportHeight="{size}">
|
||||
<group android:scaleX="{s:.4f}" android:scaleY="{s:.4f}" android:translateX="{tx:.3f}" android:translateY="{tx:.3f}">
|
||||
{stroke('M17,32 C24,32 24,21 31,21', '#FF8FA8FF')}
|
||||
{stroke('M17,32 C24,32 24,43 31,43', '#FF8FA8FF')}
|
||||
{stroke('M33,21 C39.5,21 39.5,32 43.6,32', '#FF5FD3B8')}
|
||||
{stroke('M33,43 C39.5,43 39.5,32 43.6,32', '#FFC59BFF')}
|
||||
{dot(15, 32, 6, '#FF8FA8FF')}
|
||||
{dot(32, 21, 5.2, '#FF5FD3B8')}
|
||||
{dot(32, 43, 5.2, '#FFC59BFF')}
|
||||
{stroke(ring, '#FF7BE39B', 3.4)}
|
||||
</group>
|
||||
</vector>
|
||||
'''
|
||||
|
||||
open(os.path.join(OUT, 'ic_launcher_foreground.xml'), 'w').write(vector(comment='Adaptive icon foreground: the graph in the 66dp safe zone.'))
|
||||
open(os.path.join(OUT, 'ic_launcher_monochrome.xml'), 'w').write(vector(color=False, comment='Themed (monochrome) icon: the same graph in one colour.'))
|
||||
# Notification small icon: 24dp, white, the graph filling most of the canvas.
|
||||
open(os.path.join(OUT, 'ic_stat_pipelines.xml'), 'w').write(vector(color=False, size=24, scale=24 / 64 * 1.12, comment='Status bar icon (white; Android tints it).'))
|
||||
print('ok')
|
||||
@@ -0,0 +1,16 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-label="Pipelines">
|
||||
<defs><linearGradient id="bg" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#1B1B24"/><stop offset="1" stop-color="#0E0E12"/></linearGradient></defs>
|
||||
<rect width="64" height="64" rx="14" fill="url(#bg)"/>
|
||||
<g transform="translate(32 32) scale(1.12) translate(-32 -32)">
|
||||
<g fill="none" stroke-width="3.6" stroke-linecap="round">
|
||||
<path d="M17 32 C24 32 24 21 31 21" stroke="#8FA8FF"/>
|
||||
<path d="M17 32 C24 32 24 43 31 43" stroke="#8FA8FF"/>
|
||||
<path d="M33 21 C39.5 21 39.5 32 43.6 32" stroke="#5FD3B8"/>
|
||||
<path d="M33 43 C39.5 43 39.5 32 43.6 32" stroke="#C59BFF"/>
|
||||
</g>
|
||||
<circle cx="15" cy="32" r="6" fill="#8FA8FF"/>
|
||||
<circle cx="32" cy="21" r="5.2" fill="#5FD3B8"/>
|
||||
<circle cx="32" cy="43" r="5.2" fill="#C59BFF"/>
|
||||
<circle cx="49" cy="32" r="4.3" fill="none" stroke="#7BE39B" stroke-width="3.4"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 945 B |
Executable
+7
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
# render.sh <svg> <size> <out.png> [bg] — renders an SVG at size×size with headless Chrome (transparent by default).
|
||||
svg=$1; size=$2; out=$3; bg=${4:-transparent}
|
||||
html=$(mktemp "${TMPDIR:-/tmp}/icon-render.XXXXXX.html")
|
||||
printf '<html><body style="margin:0;background:%s"><img src="file://%s" style="width:%spx;height:%spx;display:block"></body></html>' "$bg" "$svg" "$size" "$size" > "$html"
|
||||
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --headless=new --disable-gpu --hide-scrollbars --default-background-color=00000000 --force-device-scale-factor=1 --allow-file-access-from-files --window-size=$size,$((size+0)) --screenshot="$out" "file://$html" >/dev/null 2>&1
|
||||
rm -f "$html"
|
||||
Reference in New Issue
Block a user