From 6c841a9f04133fa868df414e57d2102d0d49e954 Mon Sep 17 00:00:00 2001 From: Jon Sterling Date: Sun, 15 Feb 2026 17:39:47 +0000 Subject: [PATCH] Clean up traffic light shading --- .../AquaKit/Windows/AquaTrafficLightButton.swift | 3 +++ Sources/AquaKit/Windows/AquaWindow.swift | 15 +++------------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/Sources/AquaKit/Windows/AquaTrafficLightButton.swift b/Sources/AquaKit/Windows/AquaTrafficLightButton.swift index ed13c31..3022ecc 100644 --- a/Sources/AquaKit/Windows/AquaTrafficLightButton.swift +++ b/Sources/AquaKit/Windows/AquaTrafficLightButton.swift @@ -84,6 +84,9 @@ open class AquaTrafficLightButton: AquaWindowControlButton, AquaTrafficLightButt color = .graphiteColor.highlight(withLevel: 0.8)! NSGraphicsContext.current?.cgContext.setAlpha(0.4) } + if effectiveAppearance.isDarkAqua { + color = color.blended(withFraction: 0.5, of: .graphiteColor.shadow(withLevel: 0.9)!)! + } let strokeWidth = 1.0 let bounds = bounds diff --git a/Sources/AquaKit/Windows/AquaWindow.swift b/Sources/AquaKit/Windows/AquaWindow.swift index 4fbedaa..19a0cc9 100644 --- a/Sources/AquaKit/Windows/AquaWindow.swift +++ b/Sources/AquaKit/Windows/AquaWindow.swift @@ -52,19 +52,19 @@ open class AquaWindow: NSWindow { switch b { case .closeButton: let button = Self.trafficLightButtonClass.init(frame: frame) - button.baseColor = Self.windowCloseButtonBaseColor.graphiteShadedInDarkMode + button.baseColor = Self.windowCloseButtonBaseColor button.systemSymbolName = "xmark" button.action = #selector(close) return button case .miniaturizeButton: let button = Self.trafficLightButtonClass.init(frame: frame) - button.baseColor = Self.windowMiniaturizeButtonBaseColor.graphiteShadedInDarkMode + button.baseColor = Self.windowMiniaturizeButtonBaseColor button.systemSymbolName = "minus" button.action = #selector(miniaturize(_:)) return button case .zoomButton: let button = Self.trafficLightButtonClass.init(frame: frame) - button.baseColor = Self.windowZoomButtonBaseColor.graphiteShadedInDarkMode + button.baseColor = Self.windowZoomButtonBaseColor button.systemSymbolName = "plus" button.action = #selector(zoom(_:)) return button @@ -93,12 +93,3 @@ open class AquaWindow: NSWindow { } } } - - -extension NSColor { - fileprivate var graphiteShadedInDarkMode: NSColor { - modifyDark { - $0.blended(withFraction: 0.6, of: .graphiteColor.shadow(withLevel: 0.9)!)! - } - } -} -- 2.51.2