Commit 7c00a1d4c6

7c00a1d4c6f3726293e82d1e793e4db4b0095bb4

parent: f85e3ec801

Verified · cmc

cmc <hello@cleberg.net> · 2026-10-10 18:33 UTC

iOS app icon: the Mac icon's artwork, full-bleed, from scripts/make-icon.swift --ios

Layout: unified · split

ios/Orgstar.xcodeproj/project.pbxproj +10
@@ -7,6 +7,7 @@
77 objects = {
88
99/* Begin PBXBuildFile section */
10 67AD8B4FFD1ED43852CFC2CA /* Orgstar/Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0B6845EF9D6D0093A0394C43 /* Orgstar/Assets.xcassets */; };
1011 1B78003BBCE8A4B809333342 /* OrgApp in Frameworks */ = {isa = PBXBuildFile; productRef = A2BE626BBE45EA52880B6169 /* OrgApp */; };
1112 1E5861C0EFE1D96CDC21A22F /* OrgApp in Frameworks */ = {isa = PBXBuildFile; productRef = BA239181876756F7732397EB /* OrgApp */; };
1213 2BE799BF03ED43EAA6849F53 /* OrgApp in Frameworks */ = {isa = PBXBuildFile; productRef = EDEF22C5B4F393296F1D17BB /* OrgApp */; };
@@ -68,6 +69,7 @@
6869 D128CD70D4E88FAA82D23FD9 /* OrgstarShare.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = OrgstarShare.appex; sourceTree = BUILT_PRODUCTS_DIR; };
6970 D72184D78ACF70837216BCBF /* OrgstarShare/Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = OrgstarShare/Info.plist; sourceTree = "<group>"; };
7071 ECD4A6B56983444E4E07CE63 /* Orgstar.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Orgstar.app; sourceTree = BUILT_PRODUCTS_DIR; };
72 0B6845EF9D6D0093A0394C43 /* Orgstar/Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Orgstar/Assets.xcassets; sourceTree = "<group>"; };
7173 F05C9F05F8A61806F30E9328 /* Orgstar/Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Orgstar/Info.plist; sourceTree = "<group>"; };
7274/* End PBXFileReference section */
7375
@@ -180,6 +182,7 @@
180182 40FCC6CF7BFC065FCDD48D4E /* Support */ = {
181183 isa = PBXGroup;
182184 children = (
185 0B6845EF9D6D0093A0394C43 /* Orgstar/Assets.xcassets */,
183186 F05C9F05F8A61806F30E9328 /* Orgstar/Info.plist */,
184187 008B67FA6385670637488313 /* Orgstar/Orgstar.entitlements */,
185188 D72184D78ACF70837216BCBF /* OrgstarShare/Info.plist */,
@@ -338,6 +341,7 @@
338341 isa = PBXResourcesBuildPhase;
339342 buildActionMask = 2147483647;
340343 files = (
344 67AD8B4FFD1ED43852CFC2CA /* Orgstar/Assets.xcassets in Resources */,
341345 );
342346 runOnlyForDeploymentPostprocessing = 0;
343347 };
@@ -481,6 +485,9 @@
481485 DEVELOPMENT_TEAM = ZCNAX3VL9D;
482486 GENERATE_INFOPLIST_FILE = NO;
483487 INFOPLIST_FILE = Orgstar/Info.plist;
488 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
489 INFOPLIST_KEY_CFBundleDisplayName = orgstar;
490 INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.productivity";
484491 LD_RUNPATH_SEARCH_PATHS = (
485492 "$(inherited)",
486493 "@executable_path/Frameworks",
@@ -563,6 +570,9 @@
563570 DEVELOPMENT_TEAM = ZCNAX3VL9D;
564571 GENERATE_INFOPLIST_FILE = NO;
565572 INFOPLIST_FILE = Orgstar/Info.plist;
573 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
574 INFOPLIST_KEY_CFBundleDisplayName = orgstar;
575 INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.productivity";
566576 LD_RUNPATH_SEARCH_PATHS = (
567577 "$(inherited)",
568578 "@executable_path/Frameworks",
ios/Orgstar/Assets.xcassets/AppIcon.appiconset/AppIcon.png added

Binary file not shown.

ios/Orgstar/Assets.xcassets/AppIcon.appiconset/Contents.json added +14
@@ -0,0 +1,14 @@
1{
2 "images" : [
3 {
4 "filename" : "AppIcon.png",
5 "idiom" : "universal",
6 "platform" : "ios",
7 "size" : "1024x1024"
8 }
9 ],
10 "info" : {
11 "author" : "xcode",
12 "version" : 1
13 }
14}
ios/Orgstar/Assets.xcassets/Contents.json added +6
@@ -0,0 +1,6 @@
1{
2 "info" : {
3 "author" : "xcode",
4 "version" : 1
5 }
6}
scripts/make-icon.swift +26 −7
@@ -1,19 +1,25 @@
1// Draws Orgstar's app icon and writes an iconset: an outline's heading star over three
2// indented lines, on a deep blue-to-violet square. Usage: swift scripts/make-icon.swift <dir.iconset>
1// Draws orgstar's app icon: an outline's heading star over three indented lines, on a deep
2// blue-to-violet square. Usage: swift scripts/make-icon.swift <dir.iconset> for the Mac's
3// iconset, or swift scripts/make-icon.swift --ios <file.png> for the iOS app's 1024-pixel icon.
34import AppKit
45
5let folder = URL(fileURLWithPath: CommandLine.arguments[1])
6try FileManager.default.createDirectory(at: folder, withIntermediateDirectories: true)
7
8func draw(_ size: CGFloat) -> NSBitmapImageRep {
6/// The Mac's icon sits on the macOS grid, a rounded square inset in a clear canvas; the iOS
7/// icon is the same square filling an opaque canvas, which iOS rounds itself.
8func draw(_ size: CGFloat, fullBleed: Bool = false) -> NSBitmapImageRep {
99 let rep = NSBitmapImageRep(bitmapDataPlanes: nil, pixelsWide: Int(size), pixelsHigh: Int(size), bitsPerSample: 8,
1010 samplesPerPixel: 4, hasAlpha: true, isPlanar: false, colorSpaceName: .deviceRGB, bytesPerRow: 0, bitsPerPixel: 0)!
1111 NSGraphicsContext.saveGraphicsState()
1212 NSGraphicsContext.current = NSGraphicsContext(bitmapImageRep: rep)
1313 let s = size / 1024
14 if fullBleed {
15 let transform = NSAffineTransform()
16 transform.scale(by: 1024 / 824)
17 transform.translateX(by: -100 * s, yBy: -100 * s)
18 transform.concat()
19 }
1420 // The macOS icon grid: an 824-point rounded square in a 1024 canvas.
1521 let square = NSRect(x: 100 * s, y: 100 * s, width: 824 * s, height: 824 * s)
16 let shape = NSBezierPath(roundedRect: square, xRadius: 185 * s, yRadius: 185 * s)
22 let shape = fullBleed ? NSBezierPath(rect: square) : NSBezierPath(roundedRect: square, xRadius: 185 * s, yRadius: 185 * s)
1723 NSGradient(colors: [NSColor(srgbRed: 0.13, green: 0.20, blue: 0.55, alpha: 1), NSColor(srgbRed: 0.40, green: 0.22, blue: 0.70, alpha: 1)])!
1824 .draw(in: shape, angle: -60)
1925 // The heading star.
@@ -32,6 +38,19 @@ func draw(_ size: CGFloat) -> NSBitmapImageRep {
3238 return rep
3339}
3440
41if CommandLine.arguments[1] == "--ios" {
42 // Without an alpha channel, as the App Store requires: drawn, then copied into an opaque image.
43 let drawn = draw(1024, fullBleed: true).cgImage!
44 let opaque = CGContext(data: nil, width: 1024, height: 1024, bitsPerComponent: 8, bytesPerRow: 0,
45 space: CGColorSpace(name: CGColorSpace.sRGB)!, bitmapInfo: CGImageAlphaInfo.noneSkipLast.rawValue)!
46 opaque.draw(drawn, in: CGRect(x: 0, y: 0, width: 1024, height: 1024))
47 let file = URL(fileURLWithPath: CommandLine.arguments[2])
48 try NSBitmapImageRep(cgImage: opaque.makeImage()!).representation(using: .png, properties: [:])!.write(to: file)
49 exit(0)
50}
51
52let folder = URL(fileURLWithPath: CommandLine.arguments[1])
53try FileManager.default.createDirectory(at: folder, withIntermediateDirectories: true)
3554for base in [16, 32, 128, 256, 512] {
3655 for scale in [1, 2] {
3756 let name = scale == 1 ? "icon_\(base)x\(base).png" : "icon_\(base)x\(base)@2x.png"