misc: new icons

This commit is contained in:
joshuafhiggins committed 2026-11-03 14:30:38 -05:00 Verified
1 parent 96c571cf36
commit ebcf64253e
31 files changed
+210 -5

No files matched your search

+21 -2
View File
@@ -1,31 +1,50 @@
import type { ConfigContext, ExpoConfig } from "expo/config"
export default ({ config }: ConfigContext): ExpoConfig => {
const variant = process.env.APP_VARIANT ?? "production"
if (!["development", "preview", "production"].includes(variant)) {
const variant =
process.env.APP_VARIANT ?? process.env.EAS_BUILD_PROFILE ?? "production"
if (
variant !== "development" &&
variant !== "preview" &&
variant !== "production"
) {
throw new Error(`Unsupported APP_VARIANT: ${variant}`)
}
const suffix = variant === "production" ? "" : `.${variant}`
const iconSuffix = variant === "production" ? "" : `-${variant}`
const nameSuffix =
variant === "development"
? " (Development)"
: variant === "preview"
? " (Preview)"
: ""
const composer = {
development: "oTunes Dev",
preview: "oTunes Preview",
production: "oTunes",
}[variant]
return {
...config,
name: `${config.name}${nameSuffix}`,
slug: config.slug!,
scheme: variant === "production" ? "otunes" : `otunes-${variant}`,
icon: `./assets/icon${iconSuffix}.png`,
ios: {
...config.ios,
bundleIdentifier: `${config.ios!.bundleIdentifier}${suffix}`,
icon: `./assets/${composer}.icon`,
},
android: {
...config.android,
package: `${config.android!.package}${suffix}`,
icon: `./assets/android-icon${iconSuffix}.png`,
adaptiveIcon: {
monochromeImage: "./assets/android-icon-monochrome.png",
foregroundImage: `./assets/android-icon-foreground${iconSuffix}.png`,
backgroundImage: `./assets/android-icon-background${iconSuffix}.png`,
},
},
}
}
+3 -2
View File
@@ -26,10 +26,11 @@
"adaptiveIcon": {
"monochromeImage": "./assets/android-icon-monochrome.png",
"foregroundImage": "./assets/android-icon-foreground.png",
"backgroundColor": "#C60322"
"backgroundImage": "./assets/android-icon-background.png"
},
"userInterfaceStyle": "dark",
"softwareKeyboardLayoutMode": "resize"
"softwareKeyboardLayoutMode": "resize",
"icon": "./assets/android-icon.png"
},
"plugins": [
"expo-router",
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 324 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 284 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 324 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 963 KiB

After

Width:  |  Height:  |  Size: 284 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

@@ -0,0 +1,53 @@
{
"fill" : {
"linear-gradient" : [
"display-p3:0.00000,0.55106,0.91748,1.00000",
"display-p3:0.00320,0.24546,0.91602,1.00000"
]
},
"groups" : [
{
"layers" : [
{
"fill-specializations" : [
{
"value" : "automatic"
},
{
"appearance" : "dark",
"value" : {
"linear-gradient" : [
"display-p3:0.00000,0.55106,0.91748,1.00000",
"display-p3:0.00320,0.24546,0.91602,1.00000"
]
}
}
],
"image-name" : "music.note.png",
"name" : "music.note",
"position" : {
"scale" : 1.5,
"translation-in-points" : [
0,
0
]
}
}
],
"shadow" : {
"kind" : "neutral",
"opacity" : 0.6
},
"translucency" : {
"enabled" : false,
"value" : 0.2
}
}
],
"supported-platforms" : {
"circles" : [
"watchOS"
],
"squares" : "shared"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

@@ -0,0 +1,53 @@
{
"fill" : {
"linear-gradient" : [
"display-p3:0.03297,0.65562,0.91748,1.00000",
"display-p3:0.01787,0.85470,0.91602,1.00000"
]
},
"groups" : [
{
"layers" : [
{
"fill-specializations" : [
{
"value" : "automatic"
},
{
"appearance" : "dark",
"value" : {
"linear-gradient" : [
"display-p3:0.03297,0.65562,0.91748,1.00000",
"display-p3:0.01787,0.85470,0.91602,1.00000"
]
}
}
],
"image-name" : "music.note.png",
"name" : "music.note",
"position" : {
"scale" : 1.5,
"translation-in-points" : [
0,
0
]
}
}
],
"shadow" : {
"kind" : "neutral",
"opacity" : 0.6
},
"translucency" : {
"enabled" : false,
"value" : 0.2
}
}
],
"supported-platforms" : {
"circles" : [
"watchOS"
],
"squares" : "shared"
}
}
+1 -1
View File
@@ -26,7 +26,7 @@
"image-name" : "music.note.png",
"name" : "music.note",
"position" : {
"scale" : 1,
"scale" : 1.5,
"translation-in-points" : [
0,
0
Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 324 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 963 KiB

After

Width:  |  Height:  |  Size: 284 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

+79
View File
@@ -0,0 +1,79 @@
"""Export Composer artwork with Xcode, then resize with Pillow.
Run on macOS with Xcode and Pillow installed: python3 scripts/generate-icons.py
"""
import json
from pathlib import Path
import shutil
import subprocess
import tempfile
from PIL import Image
ROOT = Path(__file__).resolve().parents[1]
ASSETS = ROOT / "apps/mobile/assets"
ICTOOL = "/Applications/Xcode.app/Contents/Applications/Icon Composer.app/Contents/Executables/ictool"
def export(source, output, rendition="Default"):
subprocess.run([
ICTOOL, str(source), "--export-image", "--output-file", str(output),
"--platform", "iOS", "--rendition", rendition,
"--width", "1024", "--height", "1024", "--scale", "1",
], check=True)
return Image.open(output).convert("RGBA")
def save(image, path, size=1024):
image.resize((size, size), Image.Resampling.LANCZOS).save(ROOT / path)
with tempfile.TemporaryDirectory(prefix="otunes-icons-") as directory:
temp = Path(directory)
for variant, composer in [("production", "oTunes"), ("development", "oTunes Dev"), ("preview", "oTunes Preview")]:
source = ASSETS / f"{composer}.icon"
icon = export(source, temp / "icon.png")
dark = export(source, temp / "dark.png", "Dark")
suffix = "" if variant == "production" else f"-{variant}"
save(icon, f"apps/mobile/assets/icon{suffix}.png")
# Android uses the Composer artwork without Apple's rounded glass base.
document = json.loads((source / "icon.json").read_text())
layer = document["groups"][0]["layers"][0]
artwork = Image.open(source / "Assets" / layer["image-name"]).convert("RGBA")
position = layer["position"]
scale = position["scale"]
artwork = artwork.resize(tuple(round(size * scale) for size in artwork.size), Image.Resampling.LANCZOS)
x, y = position["translation-in-points"]
foreground = Image.new("RGBA", (1024, 1024))
foreground.alpha_composite(artwork, (round((1024 - artwork.width) / 2 + x), round((1024 - artwork.height) / 2 + y)))
# Android's adaptive canvas includes an outer area reserved for motion.
adaptive = Image.new("RGBA", (1024, 1024))
adaptive.alpha_composite(foreground.resize((682, 682), Image.Resampling.LANCZOS), (171, 171))
save(adaptive, f"apps/mobile/assets/android-icon-foreground{suffix}.png")
# Use the rendered background's center column to retain Composer colors.
background_source = temp / "background.icon"
shutil.copytree(source, background_source, dirs_exist_ok=True)
document = json.loads((source / "icon.json").read_text())
document["groups"] = []
(background_source / "icon.json").write_text(json.dumps(document))
background = export(background_source, temp / "background.png")
background = background.crop((512, 0, 513, 1024)).resize((1024, 1024))
save(background, f"apps/mobile/assets/android-icon-background{suffix}.png")
save(Image.alpha_composite(background, foreground), f"apps/mobile/assets/android-icon{suffix}.png")
if variant != "production":
continue
monochrome = Image.new("RGBA", adaptive.size, "white")
monochrome.putalpha(adaptive.getchannel("A"))
save(monochrome, "apps/mobile/assets/android-icon-monochrome.png")
for name, image in [("icon-dark", dark), ("ios-icon", icon), ("ios-icon-dark", dark)]:
save(image, f"apps/mobile/assets/{name}.png")
for name, image in [("logo", icon), ("logo-dark", dark)]:
save(image, f"apps/web/public/{name}.png")
for path, size, image in [
("favicon.png", 64, icon),
("apps/mobile/assets/favicon.png", 64, icon),
("apps/web/app/favicon.png", 128, icon),
("apps/web/public/favicon.png", 128, icon),
("apps/web/public/favicon-dark.png", 128, dark),
]:
save(image, path, size)