diff --git a/Sources/Panels/BrowserPanelView.swift b/Sources/Panels/BrowserPanelView.swift index 7aa2a29b..f91855dd 100644 --- a/Sources/Panels/BrowserPanelView.swift +++ b/Sources/Panels/BrowserPanelView.swift @@ -180,20 +180,19 @@ func resolvedBrowserChromeBackgroundColor( func resolvedBrowserOmnibarPillBackgroundColor( for colorScheme: ColorScheme, - themeBackgroundColor: NSColor, - accentColor: NSColor + themeBackgroundColor: NSColor ) -> NSColor { - let accentMix: CGFloat + let darkenMix: CGFloat switch colorScheme { case .light: - accentMix = 0.02 + darkenMix = 0.04 case .dark: - accentMix = 0.03 + darkenMix = 0.05 @unknown default: - accentMix = 0.02 + darkenMix = 0.04 } - return themeBackgroundColor.blended(withFraction: accentMix, of: accentColor) ?? themeBackgroundColor + return themeBackgroundColor.blended(withFraction: darkenMix, of: .black) ?? themeBackgroundColor } /// View for rendering a browser panel with address bar @@ -278,8 +277,7 @@ struct BrowserPanelView: View { private var omnibarPillBackgroundColor: NSColor { resolvedBrowserOmnibarPillBackgroundColor( for: colorScheme, - themeBackgroundColor: browserChromeBackgroundColor, - accentColor: .controlAccentColor + themeBackgroundColor: browserChromeBackgroundColor ) } diff --git a/cmuxTests/CmuxWebViewKeyEquivalentTests.swift b/cmuxTests/CmuxWebViewKeyEquivalentTests.swift index 0bce884b..c3a0ef37 100644 --- a/cmuxTests/CmuxWebViewKeyEquivalentTests.swift +++ b/cmuxTests/CmuxWebViewKeyEquivalentTests.swift @@ -690,29 +690,27 @@ final class BrowserPanelChromeBackgroundColorTests: XCTestCase { } final class BrowserPanelOmnibarPillBackgroundColorTests: XCTestCase { - func testLightModeUsesSubtleAccentTintOverThemeBackground() { - assertResolvedColorMatchesExpectedBlend(for: .light, accentMix: 0.02) + func testLightModeSlightlyDarkensThemeBackground() { + assertResolvedColorMatchesExpectedBlend(for: .light, darkenMix: 0.04) } - func testDarkModeUsesSlightlyStrongerAccentTintOverThemeBackground() { - assertResolvedColorMatchesExpectedBlend(for: .dark, accentMix: 0.03) + func testDarkModeSlightlyDarkensThemeBackground() { + assertResolvedColorMatchesExpectedBlend(for: .dark, darkenMix: 0.05) } private func assertResolvedColorMatchesExpectedBlend( for colorScheme: ColorScheme, - accentMix: CGFloat, + darkenMix: CGFloat, file: StaticString = #filePath, line: UInt = #line ) { let themeBackground = NSColor(srgbRed: 0.94, green: 0.93, blue: 0.91, alpha: 1.0) - let accent = NSColor(srgbRed: 0.25, green: 0.47, blue: 0.92, alpha: 1.0) - let expected = themeBackground.blended(withFraction: accentMix, of: accent) ?? themeBackground + let expected = themeBackground.blended(withFraction: darkenMix, of: .black) ?? themeBackground guard let actual = resolvedBrowserOmnibarPillBackgroundColor( for: colorScheme, - themeBackgroundColor: themeBackground, - accentColor: accent + themeBackgroundColor: themeBackground ).usingColorSpace(.sRGB), let expectedSRGB = expected.usingColorSpace(.sRGB), let themeSRGB = themeBackground.usingColorSpace(.sRGB)