Fill the launcher icon's shape instead of framing it in white
Launchers on Android 8+ and Android Auto put the old icon, a rounded square with a transparent margin, inside their own shape and filled the margin with white. Both apps now have an adaptive icon (the gradient behind a wave layer, which also serves as the themed monochrome icon), and the legacy PNGs are opaque full-bleed squares, so nothing is left to frame. make_icon.py draws both with --foreground and --square. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No files matched your search
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- The aubergine gradient behind the launcher icon's waves. -->
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<gradient
|
||||||
|
android:angle="270"
|
||||||
|
android:endColor="#1C1A22"
|
||||||
|
android:startColor="#353042" />
|
||||||
|
</shape>
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Full-bleed layers, so launchers fill their icon shape instead of framing
|
||||||
|
the legacy PNG. Drawn by tool/make_icon.py in foreground mode. -->
|
||||||
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<background android:drawable="@drawable/ic_launcher_background" />
|
||||||
|
<foreground android:drawable="@mipmap/ic_launcher_foreground" />
|
||||||
|
<monochrome android:drawable="@mipmap/ic_launcher_foreground" />
|
||||||
|
</adaptive-icon>
|
||||||
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 7.1 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 56 KiB |
@@ -3,6 +3,16 @@
|
|||||||
|
|
||||||
Aubergine squircle with amber wave lines, matching the My Wave hero.
|
Aubergine squircle with amber wave lines, matching the My Wave hero.
|
||||||
Usage: python3 tool/make_icon.py assets/icon/musyx.png
|
Usage: python3 tool/make_icon.py assets/icon/musyx.png
|
||||||
|
|
||||||
|
With --foreground it draws the adaptive icon's foreground instead: the waves
|
||||||
|
alone on a transparent, full-bleed 108dp canvas, laid out so the launcher's
|
||||||
|
mask (the middle 72dp) shows what the squircle does. The background layer is
|
||||||
|
the gradient in res/drawable/ic_launcher_background.xml.
|
||||||
|
|
||||||
|
With --square it draws the legacy res/mipmap-*/ic_launcher.png: the artwork as
|
||||||
|
an opaque, full-bleed square. Anything that still loads the legacy icon on a
|
||||||
|
newer Android (Android Auto's media header does) wraps it in a shape, and any
|
||||||
|
transparent margin left in it shows there as a white frame.
|
||||||
"""
|
"""
|
||||||
import math
|
import math
|
||||||
import struct
|
import struct
|
||||||
@@ -12,6 +22,12 @@ import zlib
|
|||||||
SIZE = 1024
|
SIZE = 1024
|
||||||
# macOS icon grid: the body is 824px, centred, with a ~185px corner radius.
|
# macOS icon grid: the body is 824px, centred, with a ~185px corner radius.
|
||||||
BODY, RADIUS = 824, 185
|
BODY, RADIUS = 824, 185
|
||||||
|
FOREGROUND = "--foreground" in sys.argv
|
||||||
|
SQUARE = "--square" in sys.argv
|
||||||
|
if FOREGROUND:
|
||||||
|
BODY = SIZE * 72 / 108
|
||||||
|
if SQUARE:
|
||||||
|
BODY = SIZE
|
||||||
OFF = (SIZE - BODY) / 2
|
OFF = (SIZE - BODY) / 2
|
||||||
TOP, BOTTOM = (0x35, 0x30, 0x42), (0x1C, 0x1A, 0x22)
|
TOP, BOTTOM = (0x35, 0x30, 0x42), (0x1C, 0x1A, 0x22)
|
||||||
AMBER = (0xF0, 0xB2, 0x3E)
|
AMBER = (0xF0, 0xB2, 0x3E)
|
||||||
@@ -51,21 +67,26 @@ def main(out):
|
|||||||
t = y / SIZE
|
t = y / SIZE
|
||||||
bg = tuple(round(TOP[i] + (BOTTOM[i] - TOP[i]) * t) for i in range(3))
|
bg = tuple(round(TOP[i] + (BOTTOM[i] - TOP[i]) * t) for i in range(3))
|
||||||
for x in range(SIZE):
|
for x in range(SIZE):
|
||||||
cover = rounded_alpha(x, y)
|
cover = 1.0 if FOREGROUND or SQUARE else rounded_alpha(x, y)
|
||||||
if cover == 0.0:
|
if cover == 0.0:
|
||||||
row += b"\x00\x00\x00\x00"
|
row += b"\x00\x00\x00\x00"
|
||||||
continue
|
continue
|
||||||
r, g, b = bg
|
r, g, b = bg
|
||||||
|
clear = 1.0 # how much of the background the lines leave showing
|
||||||
for k in range(LINES):
|
for k in range(LINES):
|
||||||
cy, slope = curves[k][x]
|
cy, slope = curves[k][x]
|
||||||
dist = abs(y + 0.5 - cy) / math.sqrt(1 + slope * slope)
|
dist = abs(y + 0.5 - cy) / math.sqrt(1 + slope * slope)
|
||||||
width = 4.0 + k * 0.9
|
width = (4.0 + k * 0.9) * BODY / 824
|
||||||
a = min(max(width / 2 - dist + 0.5, 0.0), 1.0)
|
a = min(max(width / 2 - dist + 0.5, 0.0), 1.0)
|
||||||
if a:
|
if a:
|
||||||
a *= 0.18 + 0.82 * (k / (LINES - 1))
|
a *= 0.18 + 0.82 * (k / (LINES - 1))
|
||||||
|
clear *= 1 - a
|
||||||
r = r + (AMBER[0] - r) * a
|
r = r + (AMBER[0] - r) * a
|
||||||
g = g + (AMBER[1] - g) * a
|
g = g + (AMBER[1] - g) * a
|
||||||
b = b + (AMBER[2] - b) * a
|
b = b + (AMBER[2] - b) * a
|
||||||
|
if FOREGROUND:
|
||||||
|
row += bytes((*AMBER, round((1 - clear) * 255)))
|
||||||
|
else:
|
||||||
row += bytes((round(r), round(g), round(b), round(cover * 255)))
|
row += bytes((round(r), round(g), round(b), round(cover * 255)))
|
||||||
rows.append(bytes(row))
|
rows.append(bytes(row))
|
||||||
|
|
||||||
@@ -81,4 +102,5 @@ def main(out):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main(sys.argv[1] if len(sys.argv) > 1 else "musyx.png")
|
args = [a for a in sys.argv[1:] if not a.startswith("--")]
|
||||||
|
main(args[0] if args else "musyx.png")
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- The aubergine gradient behind the launcher icon's waves. -->
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<gradient
|
||||||
|
android:angle="270"
|
||||||
|
android:endColor="#1C1A22"
|
||||||
|
android:startColor="#353042" />
|
||||||
|
</shape>
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Full-bleed layers, so launchers fill their icon shape instead of framing
|
||||||
|
the legacy PNG. Drawn by tool/make_icon.py in foreground mode. -->
|
||||||
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<background android:drawable="@drawable/ic_launcher_background" />
|
||||||
|
<foreground android:drawable="@mipmap/ic_launcher_foreground" />
|
||||||
|
<monochrome android:drawable="@mipmap/ic_launcher_foreground" />
|
||||||
|
</adaptive-icon>
|
||||||
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 7.1 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 56 KiB |