tangled
alpha
login
or
join now
jonmsterling.com
/
AquaKit
4
fork
atom
A collection of user interface components and drawing routines for building tasteful apps using AppKit.
appkit
swift
aqua
ui
mac
4
fork
atom
overview
issues
1
pulls
pipelines
Clean up traffic light shading
jonmsterling.com
1 month ago
6c841a9f
789c33e0
+6
-12
2 changed files
expand all
collapse all
unified
split
Sources
AquaKit
Windows
AquaTrafficLightButton.swift
AquaWindow.swift
+3
Sources/AquaKit/Windows/AquaTrafficLightButton.swift
···
84
84
color = .graphiteColor.highlight(withLevel: 0.8)!
85
85
NSGraphicsContext.current?.cgContext.setAlpha(0.4)
86
86
}
87
87
+
if effectiveAppearance.isDarkAqua {
88
88
+
color = color.blended(withFraction: 0.5, of: .graphiteColor.shadow(withLevel: 0.9)!)!
89
89
+
}
87
90
88
91
let strokeWidth = 1.0
89
92
let bounds = bounds
+3
-12
Sources/AquaKit/Windows/AquaWindow.swift
···
52
52
switch b {
53
53
case .closeButton:
54
54
let button = Self.trafficLightButtonClass.init(frame: frame)
55
55
-
button.baseColor = Self.windowCloseButtonBaseColor.graphiteShadedInDarkMode
55
55
+
button.baseColor = Self.windowCloseButtonBaseColor
56
56
button.systemSymbolName = "xmark"
57
57
button.action = #selector(close)
58
58
return button
59
59
case .miniaturizeButton:
60
60
let button = Self.trafficLightButtonClass.init(frame: frame)
61
61
-
button.baseColor = Self.windowMiniaturizeButtonBaseColor.graphiteShadedInDarkMode
61
61
+
button.baseColor = Self.windowMiniaturizeButtonBaseColor
62
62
button.systemSymbolName = "minus"
63
63
button.action = #selector(miniaturize(_:))
64
64
return button
65
65
case .zoomButton:
66
66
let button = Self.trafficLightButtonClass.init(frame: frame)
67
67
-
button.baseColor = Self.windowZoomButtonBaseColor.graphiteShadedInDarkMode
67
67
+
button.baseColor = Self.windowZoomButtonBaseColor
68
68
button.systemSymbolName = "plus"
69
69
button.action = #selector(zoom(_:))
70
70
return button
···
93
93
}
94
94
}
95
95
}
96
96
-
97
97
-
98
98
-
extension NSColor {
99
99
-
fileprivate var graphiteShadedInDarkMode: NSColor {
100
100
-
modifyDark {
101
101
-
$0.blended(withFraction: 0.6, of: .graphiteColor.shadow(withLevel: 0.9)!)!
102
102
-
}
103
103
-
}
104
104
-
}