Skip to content

Commit 3d2e561

Browse files
committed
Simplify app icon
1 parent e2688d1 commit 3d2e561

1 file changed

Lines changed: 22 additions & 31 deletions

File tree

scripts/make_icon.swift

Lines changed: 22 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,10 @@ func drawIcon(size: CGFloat) -> NSImage {
5757
let canvas = CGRect(x: 0, y: 0, width: size, height: size)
5858
let backgroundTop = NSColor(calibratedRed: 0.035, green: 0.045, blue: 0.060, alpha: 1)
5959
let backgroundBottom = NSColor(calibratedRed: 0.000, green: 0.000, blue: 0.000, alpha: 1)
60-
let barTop = NSColor(calibratedRed: 0.250, green: 0.700, blue: 1.000, alpha: 1)
61-
let barBottom = NSColor(calibratedRed: 0.000, green: 0.340, blue: 0.880, alpha: 1)
62-
let barShadow = NSColor(calibratedRed: 0.000, green: 0.180, blue: 0.520, alpha: 0.35)
63-
let axisColor = NSColor(calibratedRed: 0.150, green: 0.510, blue: 1.000, alpha: 0.34)
64-
let shineColor = NSColor.white.withAlphaComponent(0.16)
60+
let barTop = NSColor(calibratedRed: 0.320, green: 0.730, blue: 1.000, alpha: 1)
61+
let barBottom = NSColor(calibratedRed: 0.030, green: 0.360, blue: 0.920, alpha: 1)
62+
let barShadow = NSColor(calibratedRed: 0.000, green: 0.110, blue: 0.360, alpha: 0.46)
63+
let barHighlight = NSColor.white.withAlphaComponent(0.15)
6564
let tile = NSBezierPath(
6665
roundedRect: canvas.insetBy(dx: size * 0.01, dy: size * 0.01),
6766
xRadius: size * 0.22,
@@ -79,46 +78,38 @@ func drawIcon(size: CGFloat) -> NSImage {
7978
innerGlow.lineWidth = max(1, size * 0.018)
8079
innerGlow.stroke()
8180

82-
let axis = NSBezierPath(roundedRect: CGRect(
83-
x: size * 0.19,
84-
y: size * 0.22,
85-
width: size * 0.62,
86-
height: size * 0.045
87-
), xRadius: size * 0.022, yRadius: size * 0.022)
88-
axisColor.setFill()
89-
axis.fill()
90-
91-
let barWidth = size * 0.115
92-
let barGap = size * 0.055
93-
let startX = size * 0.245
94-
let baseY = size * 0.245
95-
let heights = [size * 0.225, size * 0.390, size * 0.545, size * 0.680]
81+
let barWidth = size * 0.165
82+
let barGap = size * 0.080
83+
let groupWidth = barWidth * 2 + barGap
84+
let startX = (size - groupWidth) / 2
85+
let baseY = size * 0.235
86+
let heights = [size * 0.430, size * 0.610]
9687

9788
for (index, height) in heights.enumerated() {
9889
let x = startX + CGFloat(index) * (barWidth + barGap)
9990
let barRect = CGRect(x: x, y: baseY, width: barWidth, height: height)
10091

101-
let shadow = NSBezierPath(roundedRect: barRect.offsetBy(dx: size * 0.020, dy: -size * 0.018),
102-
xRadius: size * 0.040,
103-
yRadius: size * 0.040)
92+
let shadow = NSBezierPath(roundedRect: barRect.offsetBy(dx: size * 0.024, dy: -size * 0.020),
93+
xRadius: size * 0.052,
94+
yRadius: size * 0.052)
10495
barShadow.setFill()
10596
shadow.fill()
10697

10798
let bar = NSBezierPath(roundedRect: barRect,
108-
xRadius: size * 0.040,
109-
yRadius: size * 0.040)
99+
xRadius: size * 0.052,
100+
yRadius: size * 0.052)
110101
NSGradient(starting: barTop, ending: barBottom)?.draw(in: bar, angle: -90)
111102

112103
let highlightRect = CGRect(
113-
x: barRect.minX + barRect.width * 0.22,
114-
y: barRect.minY + barRect.height * 0.10,
115-
width: barRect.width * 0.26,
116-
height: barRect.height * 0.82
104+
x: barRect.minX + barRect.width * 0.28,
105+
y: barRect.minY + barRect.height * 0.14,
106+
width: barRect.width * 0.20,
107+
height: barRect.height * 0.72
117108
)
118109
let highlight = NSBezierPath(roundedRect: highlightRect,
119-
xRadius: size * 0.018,
120-
yRadius: size * 0.018)
121-
shineColor.setFill()
110+
xRadius: size * 0.020,
111+
yRadius: size * 0.020)
112+
barHighlight.setFill()
122113
highlight.fill()
123114
}
124115

0 commit comments

Comments
 (0)