From b52747972d77093f61cb19edec93a82f627cea24 Mon Sep 17 00:00:00 2001 From: Markus Wageringel Date: Fri, 22 Jul 2022 18:26:30 +0200 Subject: [PATCH] change icon and add adaptive icon This also fixes the scaling of the maskable web icons. --- .gitignore | 2 + Makefile | 16 ++++-- assets/launcher_icon.svg | 75 ++++++++++++++++--------- assets/launcher_icon_adaptive.svg | 92 +++++++++++++++++++++++++++++++ pubspec.yaml | 2 + web/manifest.json | 4 +- 6 files changed, 158 insertions(+), 33 deletions(-) create mode 100644 assets/launcher_icon_adaptive.svg diff --git a/.gitignore b/.gitignore index 52c5622..b50b39b 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,8 @@ *.ico *.apk *.apk.sha1 +/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +/android/app/src/main/res/values/colors.xml # Miscellaneous *.class diff --git a/Makefile b/Makefile index 36296a7..d907b72 100644 --- a/Makefile +++ b/Makefile @@ -31,23 +31,31 @@ assets-web: fonts icons-web icons-android: android/app/src/main/res/mipmap-hdpi/ic_launcher.png assets/launcher_icon.png: assets/launcher_icon.svg rsvg-convert --width=1024 --height=1024 --keep-aspect-ratio assets/launcher_icon.svg > $@ -android/app/src/main/res/mipmap-hdpi/ic_launcher.png: assets/launcher_icon.png +assets/launcher_icon_adaptive.png: assets/launcher_icon_adaptive.svg + rsvg-convert --page-width=1024 --page-height=1024 --width=584 --height=584 --top=220 --left=220 --keep-aspect-ratio assets/launcher_icon_adaptive.svg > $@ +android/app/src/main/res/mipmap-hdpi/ic_launcher.png: assets/launcher_icon.png assets/launcher_icon_adaptive.png $(FLUTTER) pub get $(FLUTTER) pub run flutter_launcher_icons:main icons-web: website/favicon.ico web/favicon.ico web/icons/Icon-192.png web/icons/Icon-maskable-192.png web/icons/Icon-512.png web/icons/Icon-maskable-512.png web/favicon.ico website/favicon.ico: assets/launcher_icon.svg magick -background none assets/launcher_icon.svg -define icon:auto-resize $@ -web/icons/Icon-192.png web/icons/Icon-maskable-192.png: assets/launcher_icon.svg +web/icons/Icon-192.png: assets/launcher_icon.svg mkdir -p web/icons/ rsvg-convert --width=192 --height=192 --keep-aspect-ratio assets/launcher_icon.svg > $@ -web/icons/Icon-512.png web/icons/Icon-maskable-512.png: assets/launcher_icon.svg +web/icons/Icon-512.png: assets/launcher_icon.svg mkdir -p web/icons/ rsvg-convert --width=512 --height=512 --keep-aspect-ratio assets/launcher_icon.svg > $@ +web/icons/Icon-maskable-192.png: assets/launcher_icon_adaptive.svg + mkdir -p web/icons/ + rsvg-convert --page-width=192 --page-height=192 --width=150 --height=150 --top=21 --left=21 --keep-aspect-ratio -b '#536dfeff' assets/launcher_icon_adaptive.svg > $@ +web/icons/Icon-maskable-512.png: assets/launcher_icon_adaptive.svg + mkdir -p web/icons/ + rsvg-convert --page-width=512 --page-height=512 --width=400 --height=400 --top=56 --left=56 --keep-aspect-ratio -b '#536dfeff' assets/launcher_icon_adaptive.svg > $@ icons-clean: rm -f android/app/src/main/res/mipmap-*/ic_launcher.png rm -f website/favicon.ico web/favicon.ico web/icons/*.png - rm -f assets/launcher_icon.png + rm -f assets/launcher_icon.png assets/launcher_icon_adaptive.png # fonts are downloaded and bundled into the app fonts: fonts/NotoSansMath-Regular.ttf diff --git a/assets/launcher_icon.svg b/assets/launcher_icon.svg index 7397272..5510bb0 100644 --- a/assets/launcher_icon.svg +++ b/assets/launcher_icon.svg @@ -7,10 +7,11 @@ viewBox="0 0 60.235294 60.235294" version="1.1" id="svg1791" - inkscape:version="1.2 (dc2aedaf03, 2022-05-15)" + inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)" sodipodi:docname="launcher_icon.svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg"> + inkscape:current-layer="layer3" /> - + + + + + + + + - + style="fill:#536dfe;fill-opacity:1;fill-rule:evenodd;stroke-width:0.285539" + d="m 528.86287,535.68072 -19.71379,42.5658 51.68888,-0.0382 -19.0253,-35.53374 -4.17353,8.30178 z m 1.1324,14.7102 6.98504,11.16235 4.05343,-8.28159 9.77124,18.26745 -30.97297,-0.16891 z" + sodipodi:nodetypes="cccccccccccc" /> + sodipodi:nodetypes="ccccccc" /> diff --git a/assets/launcher_icon_adaptive.svg b/assets/launcher_icon_adaptive.svg new file mode 100644 index 0000000..fbe47db --- /dev/null +++ b/assets/launcher_icon_adaptive.svg @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + diff --git a/pubspec.yaml b/pubspec.yaml index 510c7df..c23043f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -107,3 +107,5 @@ flutter_icons: android: true ios: false image_path: assets/launcher_icon.png + adaptive_icon_foreground: assets/launcher_icon_adaptive.png + adaptive_icon_background: "#536dfe" diff --git a/web/manifest.json b/web/manifest.json index 20a155d..31d3e31 100644 --- a/web/manifest.json +++ b/web/manifest.json @@ -3,8 +3,8 @@ "short_name": "everest", "start_url": ".", "display": "standalone", - "background_color": "#0175C2", - "theme_color": "#0175C2", + "background_color": "#536dfe", + "theme_color": "#536dfe", "description": "A mathematical puzzle game.", "orientation": "portrait-primary", "prefer_related_applications": false,