// // KMAppearance.swift // PDF Master // // Created by tangchao on 2023/4/17. // import Cocoa @objc class KMAppearance: NSObject { class func isDarkMode() -> Bool { var result = false if #available(macOS 10.14, *) { let appearanceName = NSApp.effectiveAppearance.bestMatch(from: [.aqua, .darkAqua]) if (appearanceName == .darkAqua) { return true } } return result } @objc class func titleColor() -> NSColor { if (KMAppearance.isSupportNewColor()) { return NSColor(named: "KMTitleColor")! } return NSColor(hex: "#252629") } internal class func isSupportNewColor() -> Bool { if #available(macOS 10.14, *) { return true } return false } }