A collection of user interface components and drawing routines for building tasteful apps using AppKit.
appkit swift aqua ui mac

Clean up traffic light shading

+6 -12
+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 + if effectiveAppearance.isDarkAqua { 88 + color = color.blended(withFraction: 0.5, of: .graphiteColor.shadow(withLevel: 0.9)!)! 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 - button.baseColor = Self.windowCloseButtonBaseColor.graphiteShadedInDarkMode 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 - button.baseColor = Self.windowMiniaturizeButtonBaseColor.graphiteShadedInDarkMode 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 - button.baseColor = Self.windowZoomButtonBaseColor.graphiteShadedInDarkMode 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 - 97 - 98 - extension NSColor { 99 - fileprivate var graphiteShadedInDarkMode: NSColor { 100 - modifyDark { 101 - $0.blended(withFraction: 0.6, of: .graphiteColor.shadow(withLevel: 0.9)!)! 102 - } 103 - } 104 - }