From 93f4b29274235157d9d4530cedd96e17b18a2624 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Wed, 11 Sep 2019 11:26:22 -0500 Subject: [PATCH] Add the ability to customize the smartfeed and folder color option using the Asset catalog --- iOS/AppAssets.swift | 10 ++++- .../masterFolderColor.colorset/Contents.json | 38 +++++++++++++++++++ .../smartFeedColor.colorset/Contents.json | 24 ++++++++++-- .../Contents.json | 6 +-- .../Contents.json | 24 ++++++++++-- 5 files changed, 91 insertions(+), 11 deletions(-) create mode 100644 iOS/Resources/Assets.xcassets/masterFolderColor.colorset/Contents.json diff --git a/iOS/AppAssets.swift b/iOS/AppAssets.swift index 276b0afe9..c1fc74950 100644 --- a/iOS/AppAssets.swift +++ b/iOS/AppAssets.swift @@ -76,8 +76,13 @@ struct AppAssets { return UIImage(systemName: "arrowtriangle.up.circle")! }() + static var masterFolderColor: UIColor = { + return UIColor(named: "masterFolderColor")! + }() + static var masterFolderImage: UIImage = { - return UIImage(systemName: "folder.fill")! + let image = UIImage(systemName: "folder.fill")! + return image.withTintColor(AppAssets.masterFolderColor, renderingMode: .alwaysOriginal) }() static var moreImage: UIImage = { @@ -109,7 +114,8 @@ struct AppAssets { }() static var smartFeedImage: UIImage = { - return UIImage(systemName: "gear")! + let image = UIImage(systemName: "gear")! + return image.withTintColor(AppAssets.smartFeedColor, renderingMode: .alwaysOriginal) }() static var starColor: UIColor = { diff --git a/iOS/Resources/Assets.xcassets/masterFolderColor.colorset/Contents.json b/iOS/Resources/Assets.xcassets/masterFolderColor.colorset/Contents.json new file mode 100644 index 000000000..982b94564 --- /dev/null +++ b/iOS/Resources/Assets.xcassets/masterFolderColor.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + }, + "colors" : [ + { + "idiom" : "universal", + "color" : { + "color-space" : "srgb", + "components" : { + "red" : "0.267", + "alpha" : "1.000", + "blue" : "0.886", + "green" : "0.565" + } + } + }, + { + "idiom" : "universal", + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "red" : "0.549", + "alpha" : "1.000", + "blue" : "0.980", + "green" : "0.749" + } + } + } + ] +} \ No newline at end of file diff --git a/iOS/Resources/Assets.xcassets/smartFeedColor.colorset/Contents.json b/iOS/Resources/Assets.xcassets/smartFeedColor.colorset/Contents.json index 76ddab11e..34a70c62e 100644 --- a/iOS/Resources/Assets.xcassets/smartFeedColor.colorset/Contents.json +++ b/iOS/Resources/Assets.xcassets/smartFeedColor.colorset/Contents.json @@ -9,10 +9,28 @@ "color" : { "color-space" : "srgb", "components" : { - "red" : "85", + "red" : "0x44", "alpha" : "1.000", - "blue" : "85", - "green" : "85" + "blue" : "0xE2", + "green" : "0x90" + } + } + }, + { + "idiom" : "universal", + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "red" : "0x8C", + "alpha" : "1.000", + "blue" : "0xFA", + "green" : "0xBF" } } } diff --git a/iOS/Resources/Assets.xcassets/tableViewCellSelectionColor.colorset/Contents.json b/iOS/Resources/Assets.xcassets/tableViewCellSelectionColor.colorset/Contents.json index f488c73d7..43fae8896 100644 --- a/iOS/Resources/Assets.xcassets/tableViewCellSelectionColor.colorset/Contents.json +++ b/iOS/Resources/Assets.xcassets/tableViewCellSelectionColor.colorset/Contents.json @@ -27,10 +27,10 @@ "color" : { "color-space" : "srgb", "components" : { - "red" : "0.267", + "red" : "0x44", "alpha" : "1.000", - "blue" : "0.886", - "green" : "0.565" + "blue" : "0xE1", + "green" : "0x90" } } } diff --git a/iOS/Resources/Assets.xcassets/timelineUnreadCircleColor.colorset/Contents.json b/iOS/Resources/Assets.xcassets/timelineUnreadCircleColor.colorset/Contents.json index 2580a0200..c50f6f9d1 100644 --- a/iOS/Resources/Assets.xcassets/timelineUnreadCircleColor.colorset/Contents.json +++ b/iOS/Resources/Assets.xcassets/timelineUnreadCircleColor.colorset/Contents.json @@ -9,10 +9,28 @@ "color" : { "color-space" : "srgb", "components" : { - "red" : "82", + "red" : "0x44", "alpha" : "1.000", - "blue" : "205", - "green" : "133" + "blue" : "0xE2", + "green" : "0x90" + } + } + }, + { + "idiom" : "universal", + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "red" : "0.549", + "alpha" : "1.000", + "blue" : "0.980", + "green" : "0.749" } } }