diff --git a/mobile/src/main/res/drawable/ic_launcher_background.xml b/mobile/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..cbee520 --- /dev/null +++ b/mobile/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/mobile/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/mobile/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..3bfebb5 --- /dev/null +++ b/mobile/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,8 @@ + + + + + + + diff --git a/mobile/src/main/res/mipmap-hdpi/ic_launcher.png b/mobile/src/main/res/mipmap-hdpi/ic_launcher.png index da57987..dae7526 100644 Binary files a/mobile/src/main/res/mipmap-hdpi/ic_launcher.png and b/mobile/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/mobile/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/mobile/src/main/res/mipmap-hdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..6b61edf Binary files /dev/null and b/mobile/src/main/res/mipmap-hdpi/ic_launcher_foreground.png differ diff --git a/mobile/src/main/res/mipmap-mdpi/ic_launcher.png b/mobile/src/main/res/mipmap-mdpi/ic_launcher.png index 3e3d14f..a55d2aa 100644 Binary files a/mobile/src/main/res/mipmap-mdpi/ic_launcher.png and b/mobile/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/mobile/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/mobile/src/main/res/mipmap-mdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..c5539b0 Binary files /dev/null and b/mobile/src/main/res/mipmap-mdpi/ic_launcher_foreground.png differ diff --git a/mobile/src/main/res/mipmap-xhdpi/ic_launcher.png b/mobile/src/main/res/mipmap-xhdpi/ic_launcher.png index b47501a..9f54af1 100644 Binary files a/mobile/src/main/res/mipmap-xhdpi/ic_launcher.png and b/mobile/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/mobile/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/mobile/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..31b6a76 Binary files /dev/null and b/mobile/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png differ diff --git a/mobile/src/main/res/mipmap-xxhdpi/ic_launcher.png b/mobile/src/main/res/mipmap-xxhdpi/ic_launcher.png index 3101957..517ac4f 100644 Binary files a/mobile/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/mobile/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/mobile/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/mobile/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..4f31214 Binary files /dev/null and b/mobile/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png differ diff --git a/mobile/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/mobile/src/main/res/mipmap-xxxhdpi/ic_launcher.png index 3fae2f5..5602882 100644 Binary files a/mobile/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/mobile/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/mobile/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/mobile/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..19c3cc4 Binary files /dev/null and b/mobile/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png differ diff --git a/tool/make_icon.py b/tool/make_icon.py index 91499b9..ffee669 100755 --- a/tool/make_icon.py +++ b/tool/make_icon.py @@ -3,6 +3,16 @@ Aubergine squircle with amber wave lines, matching the My Wave hero. 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 struct @@ -12,6 +22,12 @@ import zlib SIZE = 1024 # macOS icon grid: the body is 824px, centred, with a ~185px corner radius. 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 TOP, BOTTOM = (0x35, 0x30, 0x42), (0x1C, 0x1A, 0x22) AMBER = (0xF0, 0xB2, 0x3E) @@ -51,22 +67,27 @@ def main(out): t = y / SIZE bg = tuple(round(TOP[i] + (BOTTOM[i] - TOP[i]) * t) for i in range(3)) 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: row += b"\x00\x00\x00\x00" continue r, g, b = bg + clear = 1.0 # how much of the background the lines leave showing for k in range(LINES): cy, slope = curves[k][x] 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) if a: a *= 0.18 + 0.82 * (k / (LINES - 1)) + clear *= 1 - a r = r + (AMBER[0] - r) * a g = g + (AMBER[1] - g) * a b = b + (AMBER[2] - b) * a - row += bytes((round(r), round(g), round(b), round(cover * 255))) + if FOREGROUND: + row += bytes((*AMBER, round((1 - clear) * 255))) + else: + row += bytes((round(r), round(g), round(b), round(cover * 255))) rows.append(bytes(row)) def chunk(kind, data): @@ -81,4 +102,5 @@ def main(out): 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") diff --git a/tv/src/main/res/drawable/ic_launcher_background.xml b/tv/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..cbee520 --- /dev/null +++ b/tv/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/tv/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/tv/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..3bfebb5 --- /dev/null +++ b/tv/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,8 @@ + + + + + + + diff --git a/tv/src/main/res/mipmap-hdpi/ic_launcher.png b/tv/src/main/res/mipmap-hdpi/ic_launcher.png index da57987..dae7526 100644 Binary files a/tv/src/main/res/mipmap-hdpi/ic_launcher.png and b/tv/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/tv/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/tv/src/main/res/mipmap-hdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..6b61edf Binary files /dev/null and b/tv/src/main/res/mipmap-hdpi/ic_launcher_foreground.png differ diff --git a/tv/src/main/res/mipmap-mdpi/ic_launcher.png b/tv/src/main/res/mipmap-mdpi/ic_launcher.png index 3e3d14f..a55d2aa 100644 Binary files a/tv/src/main/res/mipmap-mdpi/ic_launcher.png and b/tv/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/tv/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/tv/src/main/res/mipmap-mdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..c5539b0 Binary files /dev/null and b/tv/src/main/res/mipmap-mdpi/ic_launcher_foreground.png differ diff --git a/tv/src/main/res/mipmap-xhdpi/ic_launcher.png b/tv/src/main/res/mipmap-xhdpi/ic_launcher.png index b47501a..9f54af1 100644 Binary files a/tv/src/main/res/mipmap-xhdpi/ic_launcher.png and b/tv/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/tv/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/tv/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..31b6a76 Binary files /dev/null and b/tv/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png differ diff --git a/tv/src/main/res/mipmap-xxhdpi/ic_launcher.png b/tv/src/main/res/mipmap-xxhdpi/ic_launcher.png index 3101957..517ac4f 100644 Binary files a/tv/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/tv/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/tv/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/tv/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..4f31214 Binary files /dev/null and b/tv/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png differ diff --git a/tv/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/tv/src/main/res/mipmap-xxxhdpi/ic_launcher.png index 3fae2f5..5602882 100644 Binary files a/tv/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/tv/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/tv/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/tv/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..19c3cc4 Binary files /dev/null and b/tv/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png differ