123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- //
- // KMTabAppearance.swift
- // PDF Master
- //
- // Created by wanjun on 2022/12/9.
- //
- import Cocoa
- @objcMembers class KMTabAppearance: NSObject {
- class func tabsTitleColor() -> NSColor? {
- if #available(macOS 10.14, *) {
- return NSColor(named: "KMTabsTitleColor")
- } else {
- return NSColor(red: 87.0 / 255.0, green: 91.0 / 255.0, blue: 117.0 / 255.0, alpha: 1.0)
- }
- }
-
- class func tabsBackgroundColor() -> NSColor? {
- var tabsViewBackgroundColor = NSColor(red: 198.0 / 255.0, green: 198.0 / 255.0, blue: 198.0 / 255.0, alpha: 1.0)
- if #available(macOS 10.14, *) {
- let appearanceName: NSAppearance.Name? = NSApp.effectiveAppearance.bestMatch(from: [.aqua, .darkAqua])
- if appearanceName == .darkAqua {
- tabsViewBackgroundColor = NSColor(red: 73.0 / 255.0, green: 73.0 / 255.0, blue: 73.0 / 255.0, alpha: 1.0)
- }
- }
- return tabsViewBackgroundColor
- }
-
- class func tabsActiveBackgroundColor() -> NSColor? {
- var tabsViewBackgroundColor = NSColor(red: 247.0 / 255.0, green: 247.0 / 255.0, blue: 247.0 / 255.0, alpha: 1.0)
- if #available(macOS 10.14, *) {
- let appearanceName: NSAppearance.Name? = NSApp.effectiveAppearance.bestMatch(from: [.aqua, .darkAqua])
- if appearanceName == .darkAqua {
- tabsViewBackgroundColor = NSColor(red: 51.0 / 255.0, green: 51.0 / 255.0, blue: 51.0 / 255.0, alpha: 1.0)
- }
- }
- return tabsViewBackgroundColor
- }
-
- class func tabsViewBackgroundColor() -> NSColor? {
- var tabsViewBackgroundColor = NSColor(red: 210.0 / 255.0, green: 210.0 / 255.0, blue: 210.0 / 255.0, alpha: 1.0)
- if #available(macOS 10.14, *) {
- let appearanceName: NSAppearance.Name? = NSApp.effectiveAppearance.bestMatch(from: [.aqua, .darkAqua])
- if appearanceName == .darkAqua {
- tabsViewBackgroundColor = NSColor(red: 61.0 / 255.0, green: 61.0 / 255.0, blue: 61.0 / 255.0, alpha: 1.0)
- }
- }
- return tabsViewBackgroundColor
- }
-
- class func tabsBorderColor() -> NSColor? {
- if #available(macOS 10.14, *) {
- return NSColor(named: "KMTabsBorderColor")
- } else {
- return NSColor(red: 0 / 255.0, green: 0 / 255.0, blue: 0 / 255.0, alpha: 0.27)
- }
- }
-
- class func mainToolBarBackgroundColor() -> NSColor? {
- var mainToolBarBackgroundColor = NSColor(red: 247.0 / 255.0, green: 247.0 / 255.0, blue: 247.0 / 255.0, alpha: 1.0)
- if #available(macOS 10.14, *) {
- let appearanceName: NSAppearance.Name? = NSApp.effectiveAppearance.bestMatch(from: [.aqua, .darkAqua])
- if appearanceName == .darkAqua {
- mainToolBarBackgroundColor = NSColor(red: 51.0 / 255.0, green: 51.0 / 255.0, blue: 51.0 / 255.0, alpha: 1.0)
- }
- }
- return mainToolBarBackgroundColor
- }
-
- class func childToolBarBackgroundColor() -> NSColor? {
- var childToolBarBackgroundColor = NSColor(red: 234.0 / 255.0, green: 234.0 / 255.0, blue: 234.0 / 255.0, alpha: 0.87)
- if #available(macOS 10.14, *) {
- let appearanceName: NSAppearance.Name? = NSApp.effectiveAppearance.bestMatch(from: [.aqua, .darkAqua])
- if appearanceName == .darkAqua {
- childToolBarBackgroundColor = NSColor(red: 12.0 / 255.0, green: 12.0 / 255.0, blue: 12.0 / 255.0, alpha: 0.87)
- }
- }
- return childToolBarBackgroundColor
- }
-
- class func mainToolBarBorderColor() -> NSColor? {
- var childToolBarBackgroundColor = NSColor(red: 192.0 / 255.0, green: 192.0 / 255.0, blue: 192.0 / 255.0, alpha: 0.6)
- if #available(macOS 10.14, *) {
- let appearanceName: NSAppearance.Name? = NSApp.effectiveAppearance.bestMatch(from: [.aqua, .darkAqua])
- if appearanceName == .darkAqua {
- childToolBarBackgroundColor = NSColor(red: 0 / 255.0, green: 0 / 255.0, blue: 0 / 255.0, alpha: 0.6)
- }
- }
- return childToolBarBackgroundColor
- }
-
- class func childToolBarBorderColor() -> NSColor? {
- var childToolBarBackgroundColor = NSColor(red: 192.0 / 255.0, green: 192.0 / 255.0, blue: 192.0 / 255.0, alpha: 1.0)
- if #available(macOS 10.14, *) {
- let appearanceName: NSAppearance.Name? = NSApp.effectiveAppearance.bestMatch(from: [.aqua, .darkAqua])
- if appearanceName == .darkAqua {
- childToolBarBackgroundColor = NSColor(red: 0 / 255.0, green: 0 / 255.0, blue: 0 / 255.0, alpha: 0.6)
- }
- }
- return childToolBarBackgroundColor
- }
-
- class func bottomToolBarBackgroundColor() -> NSColor? {
- var childToolBarBackgroundColor = NSColor(red: 226.0 / 255.0, green: 226.0 / 255.0, blue: 192.0 / 226.0, alpha: 0.87)
- if #available(macOS 10.14, *) {
- let appearanceName: NSAppearance.Name? = NSApp.effectiveAppearance.bestMatch(from: [.aqua, .darkAqua])
- if appearanceName == .darkAqua {
- childToolBarBackgroundColor = NSColor(red: 45.0 / 255.0, green: 45.0 / 255.0, blue: 45.0 / 255.0, alpha: 0.87)
- }
- }
- return childToolBarBackgroundColor
- }
- }
|