Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions LoopFollow.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2389,6 +2389,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = ECA3EFB4037410B4973BB632 /* Pods-LoopFollow.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = "LoopFollow/Loop Follow.entitlements";
CODE_SIGN_STYLE = Automatic;
Expand All @@ -2412,6 +2413,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 059B0FA59AABFE72FE13DDDA /* Pods-LoopFollow.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = "LoopFollow/Loop Follow.entitlements";
CODE_SIGN_STYLE = Automatic;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
151 changes: 38 additions & 113 deletions LoopFollow/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
@@ -1,116 +1,41 @@
{
"images" : [
{
"filename" : "40.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "60.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"filename" : "58.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "87.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"filename" : "80.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "120.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"filename" : "120-1.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"filename" : "180.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"filename" : "20.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "20x20"
},
{
"filename" : "40-1.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "29.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "29x29"
},
{
"filename" : "58-1.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "40-2.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "40x40"
},
{
"filename" : "80-1.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "76.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "76x76"
},
{
"filename" : "152.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "76x76"
},
{
"filename" : "167.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "83.5x83.5"
},
{
"filename" : "1024.png",
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
"images" : [
{
"filename" : "1024.png",
"idiom" : "universal",
"platform" : "ios",
"scale" : "1x",
"size" : "1024x1024"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "1024-dark.png",
"idiom" : "universal",
"platform" : "ios",
"scale" : "1x",
"size" : "1024x1024"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "tinted"
}
],
"filename" : "1024-tinted.png",
"idiom" : "universal",
"platform" : "ios",
"scale" : "1x",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
171 changes: 130 additions & 41 deletions LoopFollow/Resources/Assets.xcassets/AppIcon.appiconset/convert_icon.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/bin/bash
# Convert SVG icon to all required iOS app icon PNG sizes using Inkscape
# Convert SVG icon to required iOS app icon PNG sizes (light, dark, tinted) using Inkscape

set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
SVG_PATH="$SCRIPT_DIR/loopfollow-icon.svg"
CONTENTS_PATH="$SCRIPT_DIR/Contents.json"

if [ ! -f "$SVG_PATH" ]; then
echo "Error: SVG file not found at $SVG_PATH"
Expand All @@ -14,58 +17,144 @@ if ! command -v inkscape &> /dev/null; then
exit 1
fi

echo "Converting SVG to iOS app icon PNGs using Inkscape..."
TMP_DIR="$(mktemp -d)"
trap 'rm -rf "$TMP_DIR"' EXIT

LIGHT_SVG="$TMP_DIR/light.svg"
DARK_SVG="$TMP_DIR/dark.svg"
TINTED_SVG="$TMP_DIR/tinted.svg"

cp "$SVG_PATH" "$LIGHT_SVG"
cp "$SVG_PATH" "$DARK_SVG"
cp "$SVG_PATH" "$TINTED_SVG"

echo "Preparing dark/tinted SVG variants without changing geometry..."

# Dark mode: keep geometry unchanged, force dark perimeter and suppress bright edge glare.
sed -i '' 's/#F8F9FA/#020617/g' "$DARK_SVG"
sed -i '' 's/#FFFFFF/#0A0F1A/g' "$DARK_SVG"
sed -i '' 's/#F0F2F5/#020617/g' "$DARK_SVG"
sed -i '' 's/opacity="0.8"/opacity="0"/g' "$DARK_SVG"
sed -i '' 's/opacity="0.25"/opacity="0"/g' "$DARK_SVG"
sed -i '' 's/stop-opacity:0.6/stop-opacity:0/g' "$DARK_SVG"
sed -i '' 's/stop-opacity:0.5/stop-opacity:0.04/g' "$DARK_SVG"
sed -i '' 's/stop-opacity:0.4/stop-opacity:0.06/g' "$DARK_SVG"
sed -i '' 's/stop-opacity:0.3/stop-opacity:0/g' "$DARK_SVG"
sed -i '' 's/stop-opacity:0.25/stop-opacity:0.08/g' "$DARK_SVG"
sed -i '' 's/stop-opacity:0.2/stop-opacity:0.04/g' "$DARK_SVG"
sed -i '' 's/stop-opacity:0.15/stop-opacity:0.08/g' "$DARK_SVG"
sed -i '' 's/stop-opacity:0.1/stop-opacity:0.03/g' "$DARK_SVG"
sed -i '' 's/stop-opacity:0.08/stop-opacity:0/g' "$DARK_SVG"
sed -i '' 's/stop-opacity:0.05/stop-opacity:0.02/g' "$DARK_SVG"

# Tinted mode: true high-contrast monochrome source so iOS tinting is visibly distinct.
sed -i '' 's/#F8F9FA/#000000/g' "$TINTED_SVG"
sed -i '' 's/#FFFFFF/#0A0A0A/g' "$TINTED_SVG"
sed -i '' 's/#F0F2F5/#000000/g' "$TINTED_SVG"
sed -i '' 's/opacity="0.8"/opacity="0"/g' "$TINTED_SVG"
sed -i '' 's/opacity="0.25"/opacity="0"/g' "$TINTED_SVG"
sed -i '' 's/#5BA3F5/#FFFFFF/g' "$TINTED_SVG"
sed -i '' 's/#4A90E2/#FFFFFF/g' "$TINTED_SVG"
sed -i '' 's/#3A7BC8/#FFFFFF/g' "$TINTED_SVG"
sed -i '' 's/stop-opacity:0.6/stop-opacity:0/g' "$TINTED_SVG"
sed -i '' 's/stop-opacity:0.5/stop-opacity:0/g' "$TINTED_SVG"
sed -i '' 's/stop-opacity:0.4/stop-opacity:0.02/g' "$TINTED_SVG"
sed -i '' 's/stop-opacity:0.3/stop-opacity:0/g' "$TINTED_SVG"
sed -i '' 's/stop-opacity:0.25/stop-opacity:0/g' "$TINTED_SVG"
sed -i '' 's/stop-opacity:0.2/stop-opacity:0/g' "$TINTED_SVG"
sed -i '' 's/stop-opacity:0.15/stop-opacity:0/g' "$TINTED_SVG"
sed -i '' 's/stop-opacity:0.1/stop-opacity:0/g' "$TINTED_SVG"
sed -i '' 's/stop-opacity:0.08/stop-opacity:0/g' "$TINTED_SVG"
sed -i '' 's/stop-opacity:0.05/stop-opacity:0/g' "$TINTED_SVG"

echo "Converting SVG variants to iOS app icon PNGs using Inkscape..."
echo "Source: $SVG_PATH"
echo ""

# iOS app icon sizes (filename size pairs)
icon_sizes=(
"20.png 20"
"29.png 29"
"40.png 40"
"40-1.png 40"
"40-2.png 40"
"58.png 58"
"58-1.png 58"
"60.png 60"
"76.png 76"
"80.png 80"
"80-1.png 80"
"87.png 87"
"120.png 120"
"120-1.png 120"
"152.png 152"
"167.png 167"
"180.png 180"
"1024.png 1024"
)
ICON_SIZE=1024
OUTPUT_LIGHT="$SCRIPT_DIR/1024.png"
OUTPUT_DARK="$SCRIPT_DIR/1024-dark.png"
OUTPUT_TINTED="$SCRIPT_DIR/1024-tinted.png"

# Remove only generated app icon files.
rm -f "$OUTPUT_LIGHT" "$OUTPUT_DARK" "$OUTPUT_TINTED"

success_count=0
total_count=${#icon_sizes[@]}

for entry in "${icon_sizes[@]}"; do
filename=$(echo $entry | cut -d' ' -f1)
size=$(echo $entry | cut -d' ' -f2)
png_path="$SCRIPT_DIR/$filename"

# Inkscape export command
if inkscape "$SVG_PATH" --export-filename="$png_path" --export-width=$size --export-height=$size --export-type=png 2>/dev/null; then
echo "✓ Created $filename (${size}x${size})"
((success_count++))
total_count=3

export_png() {
local source_svg="$1"
local output_path="$2"
local output_name
output_name="$(basename "$output_path")"

if inkscape "$source_svg" --export-filename="$output_path" --export-width="$ICON_SIZE" --export-height="$ICON_SIZE" --export-type=png 2>/dev/null; then
echo "✓ Created $output_name (${ICON_SIZE}x${ICON_SIZE})"
((success_count+=1))
else
echo "✗ Error creating $filename"
echo "✗ Error creating $output_name"
fi
done
}

export_png "$LIGHT_SVG" "$OUTPUT_LIGHT"
export_png "$DARK_SVG" "$OUTPUT_DARK"
export_png "$TINTED_SVG" "$OUTPUT_TINTED"

echo ""
echo "✓ Successfully created $success_count/$total_count icon files"

if [ $success_count -eq $total_count ]; then
echo ""
echo "All icons created successfully!"
exit 0
else
if [ "$success_count" -ne "$total_count" ]; then
echo ""
echo "Some icons failed to create. Please check errors above."
exit 1
fi

echo ""
echo "Regenerating $CONTENTS_PATH in iOS single-size Any/Dark/Tinted format..."

cat > "$CONTENTS_PATH" << 'EOF'
{
"images" : [
{
"filename" : "1024.png",
"idiom" : "universal",
"platform" : "ios",
"scale" : "1x",
"size" : "1024x1024"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "1024-dark.png",
"idiom" : "universal",
"platform" : "ios",
"scale" : "1x",
"size" : "1024x1024"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "tinted"
}
],
"filename" : "1024-tinted.png",
"idiom" : "universal",
"platform" : "ios",
"scale" : "1x",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
EOF

echo ""
echo "All icons and appearance mappings created successfully."