mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-22 23:58:36 +01:00
Unify the colori scheme into primary and secondary accent colors
This commit is contained in:
parent
372fb06716
commit
db2ee18299
@ -18,14 +18,6 @@ struct AppAssets {
|
||||
return UIColor(named: "barBackgroundColor")!
|
||||
}()
|
||||
|
||||
static var barTintColor: UIColor = {
|
||||
return UIColor(named: "barTintColor")!
|
||||
}()
|
||||
|
||||
static var barTitleColor: UIColor = {
|
||||
return UIColor(named: "barTitleColor")!
|
||||
}()
|
||||
|
||||
static var circleClosedImage: UIImage = {
|
||||
return UIImage(systemName: "largecircle.fill.circle")!
|
||||
}()
|
||||
@ -80,14 +72,14 @@ struct AppAssets {
|
||||
return UIImage(systemName: "ellipsis.circle")!
|
||||
}()
|
||||
|
||||
static var netNewsWireBlueColor: UIColor = {
|
||||
return UIColor(named: "netNewsWireBlueColor")!
|
||||
}()
|
||||
|
||||
static var openInSidebarImage: UIImage = {
|
||||
return UIImage(systemName: "arrow.turn.down.left")!
|
||||
}()
|
||||
|
||||
static var primaryAccentColor: UIColor = {
|
||||
return UIColor(named: "primaryAccentColor")!
|
||||
}()
|
||||
|
||||
static var safariImage: UIImage = {
|
||||
return UIImage(systemName: "safari")!
|
||||
}()
|
||||
@ -96,6 +88,10 @@ struct AppAssets {
|
||||
return UIImage(named: "magnifyingglass")!
|
||||
}()
|
||||
|
||||
static var secondaryAccentColor: UIColor = {
|
||||
return UIColor(named: "secondaryAccentColor")!
|
||||
}()
|
||||
|
||||
static var shareImage: UIImage = {
|
||||
return UIImage(systemName: "square.and.arrow.up")!
|
||||
}()
|
||||
@ -124,23 +120,11 @@ struct AppAssets {
|
||||
return UIColor(named: "tableViewCellHighlightedTextColor")!
|
||||
}()
|
||||
|
||||
static var tableViewCellIconColor: UIColor = {
|
||||
return UIColor(named: "tableViewCellIconColor")!
|
||||
}()
|
||||
|
||||
static var tableViewCellSelectionColor: UIColor = {
|
||||
return UIColor(named: "tableViewCellSelectionColor")!
|
||||
}()
|
||||
|
||||
static var timelineStarImage: UIImage = {
|
||||
let image = UIImage(systemName: "star.fill")!
|
||||
return image.withTintColor(AppAssets.starColor, renderingMode: .alwaysOriginal)
|
||||
}()
|
||||
|
||||
static var timelineUnreadCircleColor: UIColor = {
|
||||
return UIColor(named: "timelineUnreadCircleColor")!
|
||||
}()
|
||||
|
||||
static var todayFeedImage: UIImage = {
|
||||
return UIImage(systemName: "sun.max.fill")!
|
||||
}()
|
||||
|
@ -113,14 +113,14 @@ class MasterFeedTableViewCell : NNWTableViewCell {
|
||||
override func setHighlighted(_ highlighted: Bool, animated: Bool) {
|
||||
super.setHighlighted(highlighted, animated: animated)
|
||||
|
||||
let tintColor = isHighlighted || isSelected ? AppAssets.tableViewCellHighlightedTextColor : AppAssets.tableViewCellIconColor
|
||||
let tintColor = isHighlighted || isSelected ? AppAssets.tableViewCellHighlightedTextColor : AppAssets.secondaryAccentColor
|
||||
faviconImageView.tintColor = tintColor
|
||||
}
|
||||
|
||||
override func setSelected(_ selected: Bool, animated: Bool) {
|
||||
super.setSelected(selected, animated: animated)
|
||||
|
||||
let tintColor = isHighlighted || isSelected ? AppAssets.tableViewCellHighlightedTextColor : AppAssets.tableViewCellIconColor
|
||||
let tintColor = isHighlighted || isSelected ? AppAssets.tableViewCellHighlightedTextColor : AppAssets.secondaryAccentColor
|
||||
faviconImageView.tintColor = tintColor
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ class MasterUnreadIndicatorView: UIView {
|
||||
}()
|
||||
|
||||
override func draw(_ dirtyRect: CGRect) {
|
||||
let color = isSelected ? AppAssets.tableViewCellHighlightedTextColor : AppAssets.timelineUnreadCircleColor
|
||||
let color = isSelected ? AppAssets.tableViewCellHighlightedTextColor : AppAssets.primaryAccentColor
|
||||
color.setFill()
|
||||
MasterUnreadIndicatorView.bezierPath.fill()
|
||||
}
|
||||
|
@ -183,7 +183,7 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner
|
||||
}
|
||||
|
||||
readAction.image = AppAssets.circleClosedImage
|
||||
readAction.backgroundColor = AppAssets.netNewsWireBlueColor
|
||||
readAction.backgroundColor = AppAssets.primaryAccentColor
|
||||
|
||||
// Set up the star action
|
||||
let starTitle = article.status.starred ?
|
||||
|
@ -24,7 +24,7 @@ public final class NavigationProgressView: UIView {
|
||||
|
||||
internal let bar = UIView()
|
||||
|
||||
@objc public dynamic var progressTintColor: UIColor? = AppAssets.barTintColor {
|
||||
@objc public dynamic var progressTintColor: UIColor? = AppAssets.primaryAccentColor {
|
||||
didSet {
|
||||
bar.backgroundColor = progressTintColor
|
||||
}
|
||||
|
@ -1,15 +0,0 @@
|
||||
{
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
},
|
||||
"colors" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"color" : {
|
||||
"platform" : "ios",
|
||||
"reference" : "labelColor"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
{
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
},
|
||||
"colors" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"red" : "0x08",
|
||||
"alpha" : "1.000",
|
||||
"blue" : "0xEE",
|
||||
"green" : "0x6A"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"appearances" : [
|
||||
{
|
||||
"appearance" : "luminosity",
|
||||
"value" : "dark"
|
||||
}
|
||||
],
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"red" : "0x44",
|
||||
"alpha" : "1.000",
|
||||
"blue" : "0xE2",
|
||||
"green" : "0x90"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -27,10 +27,10 @@
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"red" : "0x44",
|
||||
"red" : "0x2D",
|
||||
"alpha" : "1.000",
|
||||
"blue" : "0xE2",
|
||||
"green" : "0x90"
|
||||
"blue" : "0xF1",
|
||||
"green" : "0x80"
|
||||
}
|
||||
}
|
||||
}
|
@ -9,10 +9,10 @@
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"red" : "0x44",
|
||||
"red" : "0x06",
|
||||
"alpha" : "1.000",
|
||||
"blue" : "0xE2",
|
||||
"green" : "0x90"
|
||||
"blue" : "0xBE",
|
||||
"green" : "0x55"
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -27,10 +27,10 @@
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"red" : "0x61",
|
||||
"red" : "0x5E",
|
||||
"alpha" : "1.000",
|
||||
"blue" : "0xFF",
|
||||
"green" : "0xAD"
|
||||
"blue" : "0xF4",
|
||||
"green" : "0x9E"
|
||||
}
|
||||
}
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
{
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
},
|
||||
"colors" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"red" : "68",
|
||||
"alpha" : "1.000",
|
||||
"blue" : "226",
|
||||
"green" : "144"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"appearances" : [
|
||||
{
|
||||
"appearance" : "luminosity",
|
||||
"value" : "dark"
|
||||
}
|
||||
],
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"red" : "0x61",
|
||||
"alpha" : "1.000",
|
||||
"blue" : "0xFF",
|
||||
"green" : "0xAD"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
{
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
},
|
||||
"colors" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"red" : "0.031",
|
||||
"alpha" : "1.000",
|
||||
"blue" : "0.933",
|
||||
"green" : "0.416"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"appearances" : [
|
||||
{
|
||||
"appearance" : "luminosity",
|
||||
"value" : "dark"
|
||||
}
|
||||
],
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"red" : "0x44",
|
||||
"alpha" : "1.000",
|
||||
"blue" : "0xE2",
|
||||
"green" : "0x90"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -34,10 +34,10 @@ a:hover {
|
||||
|
||||
:root {
|
||||
color-scheme: light dark;
|
||||
--link-color: hsla(215, 99%, 43%, 1);
|
||||
--link-color: #0655BE;
|
||||
--header-table-border-color: rgba(0, 0, 0, 0.1);
|
||||
--header-color: rgba(0, 0, 0, 0.3);
|
||||
--header-link-color: rgba(0, 0, 0, 0.3);
|
||||
--header-link-color: #086AEE;
|
||||
--body-code-color: #666;
|
||||
--system-message-color: #cbcbcb;
|
||||
--feedlink-color: rgba(0, 0, 0, 0.6);
|
||||
@ -45,10 +45,10 @@ a:hover {
|
||||
|
||||
@media(prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--link-color: #61ADFF;
|
||||
--link-color: #5E9EF4;
|
||||
--header-table-border-color: rgba(255, 255, 255, 0.1);
|
||||
--header-color: #d2d2d2;
|
||||
--header-link-color: #4490e2;
|
||||
--header-link-color: #2D80F1;
|
||||
--body-code-color: #b2b2b2;
|
||||
--system-message-color: #5f5f5f
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
||||
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
|
||||
|
||||
window = UIWindow(windowScene: scene as! UIWindowScene)
|
||||
window!.tintColor = AppAssets.netNewsWireBlueColor
|
||||
window!.tintColor = AppAssets.primaryAccentColor
|
||||
window!.rootViewController = coordinator.start(for: window!.frame.size)
|
||||
|
||||
if let shortcutItem = connectionOptions.shortcutItem {
|
||||
|
@ -18,8 +18,8 @@ struct VibrantButtonStyle: ButtonStyle {
|
||||
.frame(width: geometry.size.width, height: geometry.size.height, alignment: self.alignment)
|
||||
}
|
||||
.foregroundColor(configuration.isPressed ? Color(AppAssets.tableViewCellHighlightedTextColor) : .primary)
|
||||
.listRowBackground(configuration.isPressed ? Color(AppAssets.tableViewCellSelectionColor) : Color(.secondarySystemGroupedBackground))
|
||||
.background(configuration.isPressed ? Color(AppAssets.tableViewCellSelectionColor) : Color(.secondarySystemGroupedBackground))
|
||||
.listRowBackground(configuration.isPressed ? Color(AppAssets.primaryAccentColor) : Color(.secondarySystemGroupedBackground))
|
||||
.background(configuration.isPressed ? Color(AppAssets.primaryAccentColor) : Color(.secondarySystemGroupedBackground))
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -18,10 +18,10 @@ struct VibrantSelectAction: ViewModifier {
|
||||
GeometryReader { geometry in
|
||||
content
|
||||
.frame(width: geometry.size.width, height: geometry.size.height, alignment: .leading)
|
||||
.background(self.isLongPressed || self.isTapped ? Color(AppAssets.tableViewCellSelectionColor) : Color(.secondarySystemGroupedBackground))
|
||||
.background(self.isLongPressed || self.isTapped ? Color(AppAssets.primaryAccentColor) : Color(.secondarySystemGroupedBackground))
|
||||
}
|
||||
.foregroundColor(isLongPressed || isTapped ? Color(AppAssets.tableViewCellHighlightedTextColor) : .primary)
|
||||
.listRowBackground(isLongPressed || isTapped ? Color(AppAssets.tableViewCellSelectionColor) : nil)
|
||||
.listRowBackground(isLongPressed || isTapped ? Color(AppAssets.primaryAccentColor) : nil)
|
||||
.gesture(
|
||||
LongPressGesture().onEnded( { _ in self.action() })
|
||||
.updating($isLongPressed) { value, state, transcation in state = value }
|
||||
|
@ -26,7 +26,7 @@ class NNWTableViewCell: UITableViewCell {
|
||||
/// Subclass overrides should call super
|
||||
func applyThemeProperties() {
|
||||
let selectedBackgroundView = UIView(frame: .zero)
|
||||
selectedBackgroundView.backgroundColor = AppAssets.tableViewCellSelectionColor
|
||||
selectedBackgroundView.backgroundColor = AppAssets.primaryAccentColor
|
||||
self.selectedBackgroundView = selectedBackgroundView
|
||||
}
|
||||
}
|
||||
|
@ -40,15 +40,15 @@ class ThemedNavigationController: UINavigationController {
|
||||
} else {
|
||||
let navigationAppearance = UINavigationBarAppearance()
|
||||
navigationAppearance.backgroundColor = AppAssets.barBackgroundColor
|
||||
navigationAppearance.titleTextAttributes = [.foregroundColor: AppAssets.barTitleColor]
|
||||
navigationAppearance.largeTitleTextAttributes = [.foregroundColor: AppAssets.barTitleColor]
|
||||
navigationAppearance.titleTextAttributes = [.foregroundColor: UIColor.label]
|
||||
navigationAppearance.largeTitleTextAttributes = [.foregroundColor: UIColor.label]
|
||||
navigationBar.standardAppearance = navigationAppearance
|
||||
navigationBar.tintColor = AppAssets.barTintColor
|
||||
navigationBar.tintColor = AppAssets.primaryAccentColor
|
||||
|
||||
let toolbarAppearance = UIToolbarAppearance()
|
||||
toolbarAppearance.backgroundColor = UIColor.white
|
||||
toolbar.standardAppearance = toolbarAppearance
|
||||
toolbar.tintColor = AppAssets.barTintColor
|
||||
toolbar.tintColor = AppAssets.primaryAccentColor
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user