diff --git a/Mac/AppAssets.swift b/Mac/AppAssets.swift index c7213c0a1..78d4d59d4 100644 --- a/Mac/AppAssets.swift +++ b/Mac/AppAssets.swift @@ -95,13 +95,13 @@ struct AppAssets { return NSImage(systemSymbolName: "line.horizontal.3.decrease.circle", accessibilityDescription: nil)! }() - static var iconLightBackgroundColor: NSColor = { - return NSColor(named: NSColor.Name("iconLightBackgroundColor"))! - }() +// static var iconLightBackgroundColor: NSColor = { +// return NSColor(named: NSColor.Name("iconLightBackgroundColor"))! +// }() - static var iconDarkBackgroundColor: NSColor = { - return NSColor(named: NSColor.Name("iconDarkBackgroundColor"))! - }() +// static var iconDarkBackgroundColor: NSColor = { +// return NSColor(named: NSColor.Name("iconDarkBackgroundColor"))! +// }() // static var legacyArticleExtractor: RSImage! = { // return RSImage(named: "legacyArticleExtractor") @@ -209,10 +209,10 @@ struct AppAssets { return IconImage(coloredImage, isSymbol: true, isBackgroundSuppressed: true, preferredColor: preferredColor.cgColor) }() - static var timelineSeparatorColor: NSColor = { - return NSColor(named: "timelineSeparatorColor")! - }() - +// static var timelineSeparatorColor: NSColor = { +// return NSColor(named: "timelineSeparatorColor")! +// }() +// static var timelineStarSelected: RSImage! = { return RSImage(named: "timelineStar")?.tinted(with: .white) }() diff --git a/Mac/MainWindow/IconView.swift b/Mac/MainWindow/IconView.swift index e0993b5ac..31c342e59 100644 --- a/Mac/MainWindow/IconView.swift +++ b/Mac/MainWindow/IconView.swift @@ -53,8 +53,8 @@ final class IconView: NSView { return imageView.frame.size.height < bounds.size.height } - private static var lightBackgroundColor = AppAssets.iconLightBackgroundColor - private static var darkBackgroundColor = AppAssets.iconDarkBackgroundColor + private static var lightBackgroundColor = AppColor.iconLightBackground + private static var darkBackgroundColor = AppColor.iconDarkBackground override init(frame frameRect: NSRect) { super.init(frame: frameRect) diff --git a/Mac/MainWindow/Timeline/TimelineTableRowView.swift b/Mac/MainWindow/Timeline/TimelineTableRowView.swift index 01f12b274..120c9cdeb 100644 --- a/Mac/MainWindow/Timeline/TimelineTableRowView.swift +++ b/Mac/MainWindow/Timeline/TimelineTableRowView.swift @@ -57,7 +57,7 @@ final class TimelineTableRowView: NSTableRowView { separator = NSView() separator!.translatesAutoresizingMaskIntoConstraints = false separator!.wantsLayer = true - separator!.layer?.backgroundColor = AppAssets.timelineSeparatorColor.cgColor + separator!.layer?.backgroundColor = AppColor.timelineSeparator.cgColor addSubview(separator!) NSLayoutConstraint.activate([ diff --git a/Shared/AppColor.swift b/Shared/AppColor.swift new file mode 100644 index 000000000..471c48e60 --- /dev/null +++ b/Shared/AppColor.swift @@ -0,0 +1,55 @@ +// +// AppColor.swift +// NetNewsWire +// +// Created by Brent Simmons on 1/27/25. +// Copyright © 2025 Ranchero Software. All rights reserved. +// + +import Foundation +#if os(macOS) +import AppKit +#elseif os(iOS) +import UIKit +#endif + +struct AppColor { + + +} + +// MARK: - Mac + +extension AppColor { + +#if os(macOS) + static var iconDarkBackground = color("iconDarkBackgroundColor") + static var iconLightBackground = color("iconLightBackgroundColor") + static var timelineSeparator = color("timelineSeparatorColor") +#endif +} + +// MARK: - iOS + +extension AppColor { + +#if os(iOS) + static var tickMark = color("tickMarkColor") +#endif +} + +// MARK: - Private + +private extension AppColor { + +#if os(macOS) + static func color(_ name: String) -> NSColor { + NSColor(named: name)! + } + +#elseif os(iOS) + static func color(_ name: String) -> UIColor { + UIColor(named: name)! + } +#endif +}