|
|
@ -105,7 +105,7 @@ extension Themer { |
|
|
|
return themeIndex == .dark ? NSColor.white : NSColor.gray |
|
|
|
return themeIndex == .dark ? NSColor.white : NSColor.gray |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func mainControlColor() -> NSColor { |
|
|
|
func mainBackgroundColor() -> NSColor { |
|
|
|
if #available(macOS 10.14, *) { |
|
|
|
if #available(macOS 10.14, *) { |
|
|
|
switch themeIndex { |
|
|
|
switch themeIndex { |
|
|
|
case .light: |
|
|
|
case .light: |
|
|
@ -113,28 +113,29 @@ extension Themer { |
|
|
|
case .dark: |
|
|
|
case .dark: |
|
|
|
return NSColor(deviceRed: 42.0 / 255.0, green: 42.0 / 255.0, blue: 42.0 / 255.0, alpha: 1.0) |
|
|
|
return NSColor(deviceRed: 42.0 / 255.0, green: 42.0 / 255.0, blue: 42.0 / 255.0, alpha: 1.0) |
|
|
|
case .system: |
|
|
|
case .system: |
|
|
|
return NSColor.controlBackgroundColor |
|
|
|
return retrieveCurrentSystem() == .light ? NSColor.white : NSColor.windowBackgroundColor |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return themeIndex == .light ? NSColor.white : NSColor(deviceRed: 42.0 / 255.0, green: 42.0 / 255.0, blue: 42.0 / 255.0, alpha: 1.0) |
|
|
|
return themeIndex == .light ? NSColor.white : NSColor(deviceRed: 55.0 / 255.0, green: 71.0 / 255.0, blue: 79.0 / 255.0, alpha: 1.0) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func mainBackgroundColor() -> NSColor { |
|
|
|
private func retrieveCurrentSystem() -> Theme { |
|
|
|
if #available(macOS 10.14, *) { |
|
|
|
if #available(OSX 10.15, *) { |
|
|
|
switch themeIndex { |
|
|
|
let appearanceDescription = NSApplication.shared.effectiveAppearance.debugDescription.lowercased() |
|
|
|
case .light: |
|
|
|
if appearanceDescription.contains("dark") { |
|
|
|
return NSColor.white |
|
|
|
return .dark |
|
|
|
case .dark: |
|
|
|
} |
|
|
|
return NSColor(deviceRed: 42.0 / 255.0, green: 42.0 / 255.0, blue: 42.0 / 255.0, alpha: 1.0) |
|
|
|
} else if #available(OSX 10.14, *) { |
|
|
|
case .system: |
|
|
|
if let appleInterfaceStyle = UserDefaults.standard.object(forKey: "AppleInterfaceStyle") as? String { |
|
|
|
return NSColor.windowBackgroundColor |
|
|
|
if appleInterfaceStyle.lowercased().contains("dark") { |
|
|
|
|
|
|
|
return .dark |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return .light |
|
|
|
return themeIndex == .light ? NSColor.white : NSColor(deviceRed: 55.0 / 255.0, green: 71.0 / 255.0, blue: 79.0 / 255.0, alpha: 1.0) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func mainTextColor() -> NSColor { |
|
|
|
func mainTextColor() -> NSColor { |
|
|
|
if #available(macOS 10.14, *) { |
|
|
|
if #available(macOS 10.14, *) { |
|
|
|
switch themeIndex { |
|
|
|
switch themeIndex { |
|
|
@ -433,7 +434,7 @@ extension Themer { |
|
|
|
case .dark: |
|
|
|
case .dark: |
|
|
|
return NSColor(deviceRed: 42.0 / 255.0, green: 55.0 / 255.0, blue: 62.0 / 255.0, alpha: 1.0) |
|
|
|
return NSColor(deviceRed: 42.0 / 255.0, green: 55.0 / 255.0, blue: 62.0 / 255.0, alpha: 1.0) |
|
|
|
case .system: |
|
|
|
case .system: |
|
|
|
return NSColor.controlBackgroundColor |
|
|
|
return retrieveCurrentSystem() == .light ? NSColor(deviceRed: 241.0 / 255.0, green: 241.0 / 255.0, blue: 241.0 / 255.0, alpha: 1.0) : NSColor.controlBackgroundColor |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|