Commit 3faae816a4
Verified · cmc
Layout: unified · split
docs/plans/2026-10-14-themes-and-icons-design.md +1 −1
| @@ -12,7 +12,7 @@ In: | |||
| 12 | - An `accent` theme slot that tints SwiftUI controls. | 12 | - An `accent` theme slot that tints SwiftUI controls. |
| 13 | - 13 app icons, each with default, dark and tinted variants for the system icon styles. | 13 | - 13 app icons, each with default, dark and tinted variants for the system icon styles. |
| 14 | - iOS: alternate app icons through `setAlternateIconName`. | 14 | - iOS: alternate app icons through `setAlternateIconName`. |
| 15 | - Mac: the selected icon shown in the Dock while the app runs; the bundle's icon compiled from an asset catalog so the system's dark and tinted styles apply to it. | 15 | - Mac: the selected icon shown in the Dock while the app runs; the bundle's icon compiled from an asset catalog. actool keeps only the default rendition for macOS, so macOS derives the dark and tinted styles itself. |
| 16 | 16 | ||
| 17 | Out: | 17 | Out: |
| 18 | 18 | ||
packaging/AppIcons.xcassets/AppIcon.appiconset/Contents.json −240
| @@ -6,299 +6,59 @@ | |||
| 6 | "scale" : "1x", | 6 | "scale" : "1x", |
| 7 | "size" : "16x16" | 7 | "size" : "16x16" |
| 8 | }, | 8 | }, |
| 9 | { | ||
| 10 | "appearances" : [ | ||
| 11 | { | ||
| 12 | "appearance" : "luminosity", | ||
| 13 | "value" : "dark" | ||
| 14 | } | ||
| 15 | ], | ||
| 16 | "filename" : "icon_16x16-dark.png", | ||
| 17 | "idiom" : "mac", | ||
| 18 | "scale" : "1x", | ||
| 19 | "size" : "16x16" | ||
| 20 | }, | ||
| 21 | { | ||
| 22 | "appearances" : [ | ||
| 23 | { | ||
| 24 | "appearance" : "luminosity", | ||
| 25 | "value" : "tinted" | ||
| 26 | } | ||
| 27 | ], | ||
| 28 | "filename" : "icon_16x16-tinted.png", | ||
| 29 | "idiom" : "mac", | ||
| 30 | "scale" : "1x", | ||
| 31 | "size" : "16x16" | ||
| 32 | }, | ||
| 33 | { | 9 | { |
| 34 | "filename" : "icon_16x16@2x.png", | 10 | "filename" : "icon_16x16@2x.png", |
| 35 | "idiom" : "mac", | 11 | "idiom" : "mac", |
| 36 | "scale" : "2x", | 12 | "scale" : "2x", |
| 37 | "size" : "16x16" | 13 | "size" : "16x16" |
| 38 | }, | 14 | }, |
| 39 | { | ||
| 40 | "appearances" : [ | ||
| 41 | { | ||
| 42 | "appearance" : "luminosity", | ||
| 43 | "value" : "dark" | ||
| 44 | } | ||
| 45 | ], | ||
| 46 | "filename" : "icon_16x16@2x-dark.png", | ||
| 47 | "idiom" : "mac", | ||
| 48 | "scale" : "2x", | ||
| 49 | "size" : "16x16" | ||
| 50 | }, | ||
| 51 | { | ||
| 52 | "appearances" : [ | ||
| 53 | { | ||
| 54 | "appearance" : "luminosity", | ||
| 55 | "value" : "tinted" | ||
| 56 | } | ||
| 57 | ], | ||
| 58 | "filename" : "icon_16x16@2x-tinted.png", | ||
| 59 | "idiom" : "mac", | ||
| 60 | "scale" : "2x", | ||
| 61 | "size" : "16x16" | ||
| 62 | }, | ||
| 63 | { | 15 | { |
| 64 | "filename" : "icon_32x32.png", | 16 | "filename" : "icon_32x32.png", |
| 65 | "idiom" : "mac", | 17 | "idiom" : "mac", |
| 66 | "scale" : "1x", | 18 | "scale" : "1x", |
| 67 | "size" : "32x32" | 19 | "size" : "32x32" |
| 68 | }, | 20 | }, |
| 69 | { | ||
| 70 | "appearances" : [ | ||
| 71 | { | ||
| 72 | "appearance" : "luminosity", | ||
| 73 | "value" : "dark" | ||
| 74 | } | ||
| 75 | ], | ||
| 76 | "filename" : "icon_32x32-dark.png", | ||
| 77 | "idiom" : "mac", | ||
| 78 | "scale" : "1x", | ||
| 79 | "size" : "32x32" | ||
| 80 | }, | ||
| 81 | { | ||
| 82 | "appearances" : [ | ||
| 83 | { | ||
| 84 | "appearance" : "luminosity", | ||
| 85 | "value" : "tinted" | ||
| 86 | } | ||
| 87 | ], | ||
| 88 | "filename" : "icon_32x32-tinted.png", | ||
| 89 | "idiom" : "mac", | ||
| 90 | "scale" : "1x", | ||
| 91 | "size" : "32x32" | ||
| 92 | }, | ||
| 93 | { | 21 | { |
| 94 | "filename" : "icon_32x32@2x.png", | 22 | "filename" : "icon_32x32@2x.png", |
| 95 | "idiom" : "mac", | 23 | "idiom" : "mac", |
| 96 | "scale" : "2x", | 24 | "scale" : "2x", |
| 97 | "size" : "32x32" | 25 | "size" : "32x32" |
| 98 | }, | 26 | }, |
| 99 | { | ||
| 100 | "appearances" : [ | ||
| 101 | { | ||
| 102 | "appearance" : "luminosity", | ||
| 103 | "value" : "dark" | ||
| 104 | } | ||
| 105 | ], | ||
| 106 | "filename" : "icon_32x32@2x-dark.png", | ||
| 107 | "idiom" : "mac", | ||
| 108 | "scale" : "2x", | ||
| 109 | "size" : "32x32" | ||
| 110 | }, | ||
| 111 | { | ||
| 112 | "appearances" : [ | ||
| 113 | { | ||
| 114 | "appearance" : "luminosity", | ||
| 115 | "value" : "tinted" | ||
| 116 | } | ||
| 117 | ], | ||
| 118 | "filename" : "icon_32x32@2x-tinted.png", | ||
| 119 | "idiom" : "mac", | ||
| 120 | "scale" : "2x", | ||
| 121 | "size" : "32x32" | ||
| 122 | }, | ||
| 123 | { | 27 | { |
| 124 | "filename" : "icon_128x128.png", | 28 | "filename" : "icon_128x128.png", |
| 125 | "idiom" : "mac", | 29 | "idiom" : "mac", |
| 126 | "scale" : "1x", | 30 | "scale" : "1x", |
| 127 | "size" : "128x128" | 31 | "size" : "128x128" |
| 128 | }, | 32 | }, |
| 129 | { | ||
| 130 | "appearances" : [ | ||
| 131 | { | ||
| 132 | "appearance" : "luminosity", | ||
| 133 | "value" : "dark" | ||
| 134 | } | ||
| 135 | ], | ||
| 136 | "filename" : "icon_128x128-dark.png", | ||
| 137 | "idiom" : "mac", | ||
| 138 | "scale" : "1x", | ||
| 139 | "size" : "128x128" | ||
| 140 | }, | ||
| 141 | { | ||
| 142 | "appearances" : [ | ||
| 143 | { | ||
| 144 | "appearance" : "luminosity", | ||
| 145 | "value" : "tinted" | ||
| 146 | } | ||
| 147 | ], | ||
| 148 | "filename" : "icon_128x128-tinted.png", | ||
| 149 | "idiom" : "mac", | ||
| 150 | "scale" : "1x", | ||
| 151 | "size" : "128x128" | ||
| 152 | }, | ||
| 153 | { | 33 | { |
| 154 | "filename" : "icon_128x128@2x.png", | 34 | "filename" : "icon_128x128@2x.png", |
| 155 | "idiom" : "mac", | 35 | "idiom" : "mac", |
| 156 | "scale" : "2x", | 36 | "scale" : "2x", |
| 157 | "size" : "128x128" | 37 | "size" : "128x128" |
| 158 | }, | 38 | }, |
| 159 | { | ||
| 160 | "appearances" : [ | ||
| 161 | { | ||
| 162 | "appearance" : "luminosity", | ||
| 163 | "value" : "dark" | ||
| 164 | } | ||
| 165 | ], | ||
| 166 | "filename" : "icon_128x128@2x-dark.png", | ||
| 167 | "idiom" : "mac", | ||
| 168 | "scale" : "2x", | ||
| 169 | "size" : "128x128" | ||
| 170 | }, | ||
| 171 | { | ||
| 172 | "appearances" : [ | ||
| 173 | { | ||
| 174 | "appearance" : "luminosity", | ||
| 175 | "value" : "tinted" | ||
| 176 | } | ||
| 177 | ], | ||
| 178 | "filename" : "icon_128x128@2x-tinted.png", | ||
| 179 | "idiom" : "mac", | ||
| 180 | "scale" : "2x", | ||
| 181 | "size" : "128x128" | ||
| 182 | }, | ||
| 183 | { | 39 | { |
| 184 | "filename" : "icon_256x256.png", | 40 | "filename" : "icon_256x256.png", |
| 185 | "idiom" : "mac", | 41 | "idiom" : "mac", |
| 186 | "scale" : "1x", | 42 | "scale" : "1x", |
| 187 | "size" : "256x256" | 43 | "size" : "256x256" |
| 188 | }, | 44 | }, |
| 189 | { | ||
| 190 | "appearances" : [ | ||
| 191 | { | ||
| 192 | "appearance" : "luminosity", | ||
| 193 | "value" : "dark" | ||
| 194 | } | ||
| 195 | ], | ||
| 196 | "filename" : "icon_256x256-dark.png", | ||
| 197 | "idiom" : "mac", | ||
| 198 | "scale" : "1x", | ||
| 199 | "size" : "256x256" | ||
| 200 | }, | ||
| 201 | { | ||
| 202 | "appearances" : [ | ||
| 203 | { | ||
| 204 | "appearance" : "luminosity", | ||
| 205 | "value" : "tinted" | ||
| 206 | } | ||
| 207 | ], | ||
| 208 | "filename" : "icon_256x256-tinted.png", | ||
| 209 | "idiom" : "mac", | ||
| 210 | "scale" : "1x", | ||
| 211 | "size" : "256x256" | ||
| 212 | }, | ||
| 213 | { | 45 | { |
| 214 | "filename" : "icon_256x256@2x.png", | 46 | "filename" : "icon_256x256@2x.png", |
| 215 | "idiom" : "mac", | 47 | "idiom" : "mac", |
| 216 | "scale" : "2x", | 48 | "scale" : "2x", |
| 217 | "size" : "256x256" | 49 | "size" : "256x256" |
| 218 | }, | 50 | }, |
| 219 | { | ||
| 220 | "appearances" : [ | ||
| 221 | { | ||
| 222 | "appearance" : "luminosity", | ||
| 223 | "value" : "dark" | ||
| 224 | } | ||
| 225 | ], | ||
| 226 | "filename" : "icon_256x256@2x-dark.png", | ||
| 227 | "idiom" : "mac", | ||
| 228 | "scale" : "2x", | ||
| 229 | "size" : "256x256" | ||
| 230 | }, | ||
| 231 | { | ||
| 232 | "appearances" : [ | ||
| 233 | { | ||
| 234 | "appearance" : "luminosity", | ||
| 235 | "value" : "tinted" | ||
| 236 | } | ||
| 237 | ], | ||
| 238 | "filename" : "icon_256x256@2x-tinted.png", | ||
| 239 | "idiom" : "mac", | ||
| 240 | "scale" : "2x", | ||
| 241 | "size" : "256x256" | ||
| 242 | }, | ||
| 243 | { | 51 | { |
| 244 | "filename" : "icon_512x512.png", | 52 | "filename" : "icon_512x512.png", |
| 245 | "idiom" : "mac", | 53 | "idiom" : "mac", |
| 246 | "scale" : "1x", | 54 | "scale" : "1x", |
| 247 | "size" : "512x512" | 55 | "size" : "512x512" |
| 248 | }, | 56 | }, |
| 249 | { | ||
| 250 | "appearances" : [ | ||
| 251 | { | ||
| 252 | "appearance" : "luminosity", | ||
| 253 | "value" : "dark" | ||
| 254 | } | ||
| 255 | ], | ||
| 256 | "filename" : "icon_512x512-dark.png", | ||
| 257 | "idiom" : "mac", | ||
| 258 | "scale" : "1x", | ||
| 259 | "size" : "512x512" | ||
| 260 | }, | ||
| 261 | { | ||
| 262 | "appearances" : [ | ||
| 263 | { | ||
| 264 | "appearance" : "luminosity", | ||
| 265 | "value" : "tinted" | ||
| 266 | } | ||
| 267 | ], | ||
| 268 | "filename" : "icon_512x512-tinted.png", | ||
| 269 | "idiom" : "mac", | ||
| 270 | "scale" : "1x", | ||
| 271 | "size" : "512x512" | ||
| 272 | }, | ||
| 273 | { | 57 | { |
| 274 | "filename" : "icon_512x512@2x.png", | 58 | "filename" : "icon_512x512@2x.png", |
| 275 | "idiom" : "mac", | 59 | "idiom" : "mac", |
| 276 | "scale" : "2x", | 60 | "scale" : "2x", |
| 277 | "size" : "512x512" | 61 | "size" : "512x512" |
| 278 | }, | ||
| 279 | { | ||
| 280 | "appearances" : [ | ||
| 281 | { | ||
| 282 | "appearance" : "luminosity", | ||
| 283 | "value" : "dark" | ||
| 284 | } | ||
| 285 | ], | ||
| 286 | "filename" : "icon_512x512@2x-dark.png", | ||
| 287 | "idiom" : "mac", | ||
| 288 | "scale" : "2x", | ||
| 289 | "size" : "512x512" | ||
| 290 | }, | ||
| 291 | { | ||
| 292 | "appearances" : [ | ||
| 293 | { | ||
| 294 | "appearance" : "luminosity", | ||
| 295 | "value" : "tinted" | ||
| 296 | } | ||
| 297 | ], | ||
| 298 | "filename" : "icon_512x512@2x-tinted.png", | ||
| 299 | "idiom" : "mac", | ||
| 300 | "scale" : "2x", | ||
| 301 | "size" : "512x512" | ||
| 302 | } | 62 | } |
| 303 | ], | 63 | ], |
| 304 | "info" : { | 64 | "info" : { |
packaging/AppIcons.xcassets/AppIcon.appiconset/icon_128x128-dark.png deleted
Binary file not shown.
packaging/AppIcons.xcassets/AppIcon.appiconset/icon_128x128-tinted.png deleted
Binary file not shown.
packaging/AppIcons.xcassets/AppIcon.appiconset/icon_128x128@2x-dark.png deleted
Binary file not shown.
packaging/AppIcons.xcassets/AppIcon.appiconset/icon_128x128@2x-tinted.png deleted
Binary file not shown.
packaging/AppIcons.xcassets/AppIcon.appiconset/icon_16x16-dark.png deleted
Binary file not shown.
packaging/AppIcons.xcassets/AppIcon.appiconset/icon_16x16-tinted.png deleted
Binary file not shown.
packaging/AppIcons.xcassets/AppIcon.appiconset/icon_16x16@2x-dark.png deleted
Binary file not shown.
packaging/AppIcons.xcassets/AppIcon.appiconset/icon_16x16@2x-tinted.png deleted
Binary file not shown.
packaging/AppIcons.xcassets/AppIcon.appiconset/icon_256x256-dark.png deleted
Binary file not shown.
packaging/AppIcons.xcassets/AppIcon.appiconset/icon_256x256-tinted.png deleted
Binary file not shown.
packaging/AppIcons.xcassets/AppIcon.appiconset/icon_256x256@2x-dark.png deleted
Binary file not shown.
packaging/AppIcons.xcassets/AppIcon.appiconset/icon_256x256@2x-tinted.png deleted
Binary file not shown.
packaging/AppIcons.xcassets/AppIcon.appiconset/icon_32x32-dark.png deleted
Binary file not shown.
packaging/AppIcons.xcassets/AppIcon.appiconset/icon_32x32-tinted.png deleted
Binary file not shown.
packaging/AppIcons.xcassets/AppIcon.appiconset/icon_32x32@2x-dark.png deleted
Binary file not shown.
packaging/AppIcons.xcassets/AppIcon.appiconset/icon_32x32@2x-tinted.png deleted
Binary file not shown.
packaging/AppIcons.xcassets/AppIcon.appiconset/icon_512x512-dark.png deleted
Binary file not shown.
packaging/AppIcons.xcassets/AppIcon.appiconset/icon_512x512-tinted.png deleted
Binary file not shown.
packaging/AppIcons.xcassets/AppIcon.appiconset/icon_512x512@2x-dark.png deleted
Binary file not shown.
packaging/AppIcons.xcassets/AppIcon.appiconset/icon_512x512@2x-tinted.png deleted
Binary file not shown.
scripts/make-icon.swift +6 −8
| @@ -137,18 +137,16 @@ for v in variants { | |||
| 137 | try write(png(draw(v, 512, look: .dark)), "packaging/IconPreviews/\(v.id)-dark.png") | 137 | try write(png(draw(v, 512, look: .dark)), "packaging/IconPreviews/\(v.id)-dark.png") |
| 138 | } | 138 | } |
| 139 | 139 | ||
| 140 | // The Mac's bundle icon: the default variant at the Mac's sizes, in each appearance. | 140 | // The Mac's bundle icon: the default variant at the Mac's sizes. actool drops dark and |
| 141 | // tinted renditions from a macOS app icon set, so macOS derives those styles itself. | ||
| 141 | let mac = "packaging/AppIcons.xcassets/AppIcon.appiconset" | 142 | let mac = "packaging/AppIcons.xcassets/AppIcon.appiconset" |
| 143 | try? FileManager.default.removeItem(atPath: mac) | ||
| 142 | var macImages: [[String: Any]] = [] | 144 | var macImages: [[String: Any]] = [] |
| 143 | for base in [16, 32, 128, 256, 512] { | 145 | for base in [16, 32, 128, 256, 512] { |
| 144 | for scale in [1, 2] { | 146 | for scale in [1, 2] { |
| 145 | for (look, suffix, appearance) in appearances { | 147 | let name = "icon_\(base)x\(base)\(scale == 2 ? "@2x" : "").png" |
| 146 | let name = "icon_\(base)x\(base)\(scale == 2 ? "@2x" : "")\(suffix).png" | 148 | try write(png(draw(variants[0], CGFloat(base * scale))), "\(mac)/\(name)") |
| 147 | try write(png(draw(variants[0], CGFloat(base * scale), look: look)), "\(mac)/\(name)") | 149 | macImages.append(["filename": name, "idiom": "mac", "scale": "\(scale)x", "size": "\(base)x\(base)"]) |
| 148 | var image: [String: Any] = ["filename": name, "idiom": "mac", "scale": "\(scale)x", "size": "\(base)x\(base)"] | ||
| 149 | if !appearance.isEmpty { image["appearances"] = appearance } | ||
| 150 | macImages.append(image) | ||
| 151 | } | ||
| 152 | } | 150 | } |
| 153 | } | 151 | } |
| 154 | try json(["images": macImages, "info": info], "\(mac)/Contents.json") | 152 | try json(["images": macImages, "info": info], "\(mac)/Contents.json") |