Commit 9cdca8a903

9cdca8a9038566b0fa3d938ef84193a033449b76

parent: 3dc07fd2dc

Verified · cmc

cmc <hello@cleberg.net> · 2026-10-16 01:23 UTC

Star icons in place of the unicorns: Org Star, Night Star, Pastel Star

Layout: unified · split

Sources/OrgPresentation/AppIcons.swift +4 −3
@@ -19,9 +19,10 @@ public enum AppIcons {
1919 case "forest": String(localized: "Forest")
2020 case "rainbow": String(localized: "Rainbow")
2121 case "outline": String(localized: "Outline")
22 case "unicorn": String(localized: "Unicorn")
23 case "unicorn-night": String(localized: "Unicorn Night")
24 case "unicorn-pastel": String(localized: "Unicorn Pastel")
22 // Ids from when these were unicorns, kept so an icon chosen then stays chosen.
23 case "unicorn": String(localized: "Org Star")
24 case "unicorn-night": String(localized: "Night Star")
25 case "unicorn-pastel": String(localized: "Pastel Star")
2526 default: words(id).joined(separator: " ")
2627 }
2728 }
Tests/OrgPresentationTests/PaletteTests.swift +1 −1
@@ -92,7 +92,7 @@ struct PaletteTests {
9292 #expect(AppIcons.alternateName("unicorn-night") == "AppIcon-UnicornNight")
9393 #expect(AppIcons.id(alternateName: "AppIcon-UnicornNight") == "unicorn-night")
9494 #expect(AppIcons.id(alternateName: nil) == "default" && AppIcons.id(alternateName: "AppIcon-Gone") == "default")
95 #expect(AppIcons.name("unicorn-pastel") == "Unicorn Pastel")
95 #expect(AppIcons.name("unicorn") == "Org Star" && AppIcons.name("unicorn-night") == "Night Star" && AppIcons.name("unicorn-pastel") == "Pastel Star")
9696 }
9797
9898 @Test func dockFilesFollowTheAppearance() {
ios/Orgstar/Assets.xcassets/AppIcon-Unicorn.appiconset/AppIcon-dark.png

Binary file not shown.

ios/Orgstar/Assets.xcassets/AppIcon-Unicorn.appiconset/AppIcon-tinted.png

Binary file not shown.

ios/Orgstar/Assets.xcassets/AppIcon-Unicorn.appiconset/AppIcon.png

Binary file not shown.

ios/Orgstar/Assets.xcassets/AppIcon-UnicornNight.appiconset/AppIcon-dark.png

Binary file not shown.

ios/Orgstar/Assets.xcassets/AppIcon-UnicornNight.appiconset/AppIcon-tinted.png

Binary file not shown.

ios/Orgstar/Assets.xcassets/AppIcon-UnicornNight.appiconset/AppIcon.png

Binary file not shown.

ios/Orgstar/Assets.xcassets/AppIcon-UnicornPastel.appiconset/AppIcon-dark.png

Binary file not shown.

ios/Orgstar/Assets.xcassets/AppIcon-UnicornPastel.appiconset/AppIcon-tinted.png

Binary file not shown.

ios/Orgstar/Assets.xcassets/AppIcon-UnicornPastel.appiconset/AppIcon.png

Binary file not shown.

ios/Orgstar/Assets.xcassets/IconPreview-unicorn-night.imageset/dark.png

Binary file not shown.

ios/Orgstar/Assets.xcassets/IconPreview-unicorn-night.imageset/light.png

Binary file not shown.

ios/Orgstar/Assets.xcassets/IconPreview-unicorn-pastel.imageset/dark.png

Binary file not shown.

ios/Orgstar/Assets.xcassets/IconPreview-unicorn-pastel.imageset/light.png

Binary file not shown.

ios/Orgstar/Assets.xcassets/IconPreview-unicorn.imageset/dark.png

Binary file not shown.

ios/Orgstar/Assets.xcassets/IconPreview-unicorn.imageset/light.png

Binary file not shown.

l10n/Localizable.xcstrings +33
@@ -3302,6 +3302,16 @@
33023302 }
33033303 }
33043304 },
3305 "Night Star": {
3306 "localizations": {
3307 "de": {
3308 "stringUnit": {
3309 "state": "translated",
3310 "value": "Nachtstern"
3311 }
3312 }
3313 }
3314 },
33053315 "No Emacs configuration found": {
33063316 "localizations": {
33073317 "de": {
@@ -3766,6 +3776,16 @@
37663776 "Org": {
37673777 "shouldTranslate": false
37683778 },
3779 "Org Star": {
3780 "localizations": {
3781 "de": {
3782 "stringUnit": {
3783 "state": "translated",
3784 "value": "Org-Stern"
3785 }
3786 }
3787 }
3788 },
37693789 "Org's date syntax works too: +2d, fri, 14:00": {
37703790 "localizations": {
37713791 "de": {
@@ -3869,6 +3889,16 @@
38693889 }
38703890 }
38713891 },
3892 "Pastel Star": {
3893 "localizations": {
3894 "de": {
3895 "stringUnit": {
3896 "state": "translated",
3897 "value": "Pastellstern"
3898 }
3899 }
3900 }
3901 },
38723902 "Pause Timer": {
38733903 "localizations": {
38743904 "de": {
@@ -5574,6 +5604,7 @@
55745604 }
55755605 },
55765606 "Unicorn": {
5607 "extractionState": "stale",
55775608 "localizations": {
55785609 "de": {
55795610 "stringUnit": {
@@ -5584,6 +5615,7 @@
55845615 }
55855616 },
55865617 "Unicorn Night": {
5618 "extractionState": "stale",
55875619 "localizations": {
55885620 "de": {
55895621 "stringUnit": {
@@ -5594,6 +5626,7 @@
55945626 }
55955627 },
55965628 "Unicorn Pastel": {
5629 "extractionState": "stale",
55975630 "localizations": {
55985631 "de": {
55995632 "stringUnit": {
packaging/IconPreviews/unicorn-dark.png

Binary file not shown.

packaging/IconPreviews/unicorn-light.png

Binary file not shown.

packaging/IconPreviews/unicorn-night-dark.png

Binary file not shown.

packaging/IconPreviews/unicorn-night-light.png

Binary file not shown.

packaging/IconPreviews/unicorn-pastel-dark.png

Binary file not shown.

packaging/IconPreviews/unicorn-pastel-light.png

Binary file not shown.

scripts/make-icon.swift +22 −45
@@ -5,7 +5,7 @@
55import AppKit
66
77struct Variant {
8 enum Style { case filled, outline, unicorn }
8 enum Style { case filled, outline, star }
99 let id: String
1010 /// The gradient, top-left to bottom-right.
1111 let top: NSColor, bottom: NSColor
@@ -30,9 +30,9 @@ let variants: [Variant] = [
3030 Variant(id: "rainbow", top: rgb(0xe40303), bottom: rgb(0x732982), glyph: .white, bars: NSColor(white: 1, alpha: 0.9)),
3131 Variant(id: "outline", top: .white, bottom: rgb(0xf2f2f2), glyph: rgb(0x2f5486), bars: rgb(0x2f5486), style: .outline),
3232 Variant(id: "terminal", top: rgb(0x0a0f0a), bottom: .black, glyph: rgb(0x39ff6a), bars: rgb(0x2bcc55)),
33 Variant(id: "unicorn", top: rgb(0x77aa99), bottom: rgb(0x3e7a6a), glyph: rgb(0xffc74d), bars: .white, style: .unicorn),
34 Variant(id: "unicorn-night", top: rgb(0x2b2a6b), bottom: rgb(0x14133a), glyph: rgb(0xd8dde6), bars: rgb(0xeae8ff), style: .unicorn),
35 Variant(id: "unicorn-pastel", top: rgb(0xffc6dd), bottom: rgb(0xc7b8ff), glyph: rgb(0xffc74d), bars: .white, style: .unicorn),
33 Variant(id: "unicorn", top: rgb(0x77aa99), bottom: rgb(0x3e7a6a), glyph: rgb(0xffc74d), bars: .white, style: .star),
34 Variant(id: "unicorn-night", top: rgb(0x2b2a6b), bottom: rgb(0x14133a), glyph: rgb(0xd8dde6), bars: rgb(0xeae8ff), style: .star),
35 Variant(id: "unicorn-pastel", top: rgb(0xffc6dd), bottom: rgb(0xc7b8ff), glyph: rgb(0xffc74d), bars: .white, style: .star),
3636]
3737
3838/// `darkTile`: the dark look on a near-black tile, for the Mac's Dock, which draws nothing
@@ -83,7 +83,7 @@ func draw(_ v: Variant, _ size: CGFloat, look: Look = .light, fullBleed: Bool =
8383 switch v.style {
8484 case .filled: drawOutline(s, glyph: glyph, bars: bars, filled: true)
8585 case .outline: drawOutline(s, glyph: glyph, bars: bars, filled: false)
86 case .unicorn: drawUnicorn(s, glyph: glyph, head: bars)
86 case .star: drawStar(s, glyph: glyph)
8787 }
8888 NSGraphicsContext.restoreGraphicsState()
8989 return rep
@@ -107,46 +107,23 @@ func drawOutline(_ s: CGFloat, glyph: NSColor, bars: NSColor, filled: Bool) {
107107 }
108108}
109109
110/// A unicorn's head in profile, facing left, with a mane; its horn ends in the heading star.
111func drawUnicorn(_ s: CGFloat, glyph: NSColor, head: NSColor) {
112 func p(_ x: CGFloat, _ y: CGFloat) -> NSPoint { NSPoint(x: x * s, y: y * s) }
113 let face = NSBezierPath()
114 face.move(to: p(640, 200)) // neck, back
115 face.curve(to: p(600, 560), controlPoint1: p(700, 330), controlPoint2: p(690, 480))
116 face.curve(to: p(470, 640), controlPoint1: p(560, 610), controlPoint2: p(520, 640)) // crown
117 face.line(to: p(440, 690)) // ear
118 face.line(to: p(410, 620))
119 face.curve(to: p(250, 470), controlPoint1: p(340, 590), controlPoint2: p(270, 530)) // brow to nose
120 face.curve(to: p(290, 400), controlPoint1: p(235, 430), controlPoint2: p(250, 400)) // muzzle
121 face.curve(to: p(430, 430), controlPoint1: p(340, 400), controlPoint2: p(390, 410)) // jaw
122 face.curve(to: p(450, 200), controlPoint1: p(470, 360), controlPoint2: p(440, 280)) // throat
123 face.close()
124 head.setFill()
125 face.fill()
126
127 let mane = NSBezierPath()
128 mane.move(to: p(600, 560))
129 mane.curve(to: p(760, 220), controlPoint1: p(720, 520), controlPoint2: p(800, 360))
130 mane.line(to: p(690, 210))
131 mane.curve(to: p(600, 520), controlPoint1: p(730, 330), controlPoint2: p(680, 470))
132 mane.close()
133 glyph.withAlphaComponent(0.85).setFill()
134 mane.fill()
135
136 let horn = NSBezierPath()
137 horn.move(to: p(440, 640))
138 horn.line(to: p(300, 790))
139 horn.line(to: p(475, 660))
140 horn.close()
141 head.blended(withFraction: 0.25, of: glyph)?.setFill()
142 horn.fill()
143
144 let eye = NSBezierPath(ovalIn: NSRect(x: 360 * s, y: 520 * s, width: 28 * s, height: 28 * s))
145 NSColor(white: 0.15, alpha: 1).setFill()
146 eye.fill()
147
148 let star = NSAttributedString(string: "✱", attributes: [.font: NSFont.systemFont(ofSize: 190 * s, weight: .heavy), .foregroundColor: glyph])
149 star.draw(at: p(205, 700))
110/// The heading star alone, filling the tile: the glyph's outline, centred and scaled to fit.
111func drawStar(_ s: CGFloat, glyph: NSColor) {
112 // The font the system draws ✱ in; the system font itself has no such glyph.
113 let font = CTFontCreateForString(NSFont.systemFont(ofSize: 100, weight: .heavy) as CTFont, "✱" as CFString, CFRange(location: 0, length: 1))
114 var character: UniChar = 0x2731
115 var glyphID: CGGlyph = 0
116 CTFontGetGlyphsForCharacters(font, &character, &glyphID, 1)
117 guard let outline = CTFontCreatePathForGlyph(font, glyphID, nil) else { return }
118 let bounds = outline.boundingBoxOfPath
119 let scale = 560 * s / max(bounds.width, bounds.height)
120 var transform = CGAffineTransform(translationX: 512 * s, y: 512 * s)
121 .scaledBy(x: scale, y: scale)
122 .translatedBy(x: -bounds.midX, y: -bounds.midY)
123 guard let placed = outline.copy(using: &transform), let context = NSGraphicsContext.current?.cgContext else { return }
124 context.addPath(placed)
125 context.setFillColor(glyph.cgColor)
126 context.fillPath()
150127}
151128
152129func png(_ rep: NSBitmapImageRep) -> Data { rep.representation(using: .png, properties: [:])! }