#!/bin/bash # Author: Simon-Pierre Boucher — contact@spboucher.ai # Renders the Forge Studio app icon (anvil-flame motif: forge gradient + # SF Symbol flame) at 1024px with AppKit, then builds AppIcon.icns. set -euo pipefail cd "$(dirname "$0")/.." mkdir -p Assets cat > /tmp/forge-studio-icon.swift <<'SWIFT' // Author: Simon-Pierre Boucher — contact@spboucher.ai import AppKit let size = CGFloat(1024) let image = NSImage(size: NSSize(width: size, height: size)) image.lockFocus() // macOS-style rounded rect with a forge-heat gradient. let inset = size * 0.08 let rect = NSRect(x: inset, y: inset, width: size - 2 * inset, height: size - 2 * inset) let path = NSBezierPath(roundedRect: rect, xRadius: size * 0.18, yRadius: size * 0.18) NSGradient(colors: [ NSColor(calibratedRed: 0.10, green: 0.10, blue: 0.14, alpha: 1), NSColor(calibratedRed: 0.22, green: 0.12, blue: 0.08, alpha: 1), ])!.draw(in: path, angle: -90) // Flame glyph, forge-orange with a warm glow. let config = NSImage.SymbolConfiguration(pointSize: size * 0.52, weight: .semibold) if let flame = NSImage(systemSymbolName: "flame.fill", accessibilityDescription: nil)? .withSymbolConfiguration(config) { let tinted = NSImage(size: flame.size) tinted.lockFocus() NSColor(calibratedRed: 1.0, green: 0.55, blue: 0.15, alpha: 1).set() let r = NSRect(origin: .zero, size: flame.size) flame.draw(in: r) r.fill(using: .sourceAtop) tinted.unlockFocus() let fr = NSRect(x: (size - flame.size.width) / 2, y: (size - flame.size.height) / 2 + size * 0.02, width: flame.size.width, height: flame.size.height) NSGraphicsContext.current?.cgContext.setShadow( offset: .zero, blur: size * 0.06, color: NSColor.orange.withAlphaComponent(0.8).cgColor) tinted.draw(in: fr) } image.unlockFocus() let tiff = image.tiffRepresentation! let png = NSBitmapImageRep(data: tiff)!.representation(using: .png, properties: [:])! try! png.write(to: URL(fileURLWithPath: "Assets/icon-1024.png")) print("Assets/icon-1024.png") SWIFT swift /tmp/forge-studio-icon.swift ICONSET="Assets/AppIcon.iconset" rm -rf "$ICONSET" && mkdir -p "$ICONSET" for s in 16 32 128 256 512; do sips -z $s $s Assets/icon-1024.png --out "$ICONSET/icon_${s}x${s}.png" >/dev/null d=$((s * 2)) sips -z $d $d Assets/icon-1024.png --out "$ICONSET/icon_${s}x${s}@2x.png" >/dev/null done iconutil -c icns "$ICONSET" -o Assets/AppIcon.icns echo "OK: Assets/AppIcon.icns"