From b3e514ad72ff5e4c72c9733f8d9e2489e8ba56d8 Mon Sep 17 00:00:00 2001 From: Saeed Bashir Date: Mon, 7 Oct 2024 13:13:05 +0500 Subject: [PATCH 1/3] chore: add course progress bg color --- .../Subviews/CourseProgressView.swift | 2 +- .../CourseProgressGB.colorset/Contents.json | 38 +++++++++++++++++++ Theme/Theme/SwiftGen/ThemeAssets.swift | 1 + Theme/Theme/Theme.swift | 1 + 4 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 Theme/Theme/Assets.xcassets/Colors/CourseProgressGB.colorset/Contents.json diff --git a/Course/Course/Presentation/Subviews/CourseProgressView.swift b/Course/Course/Presentation/Subviews/CourseProgressView.swift index 70ee1c2d8..cbc66ebb3 100644 --- a/Course/Course/Presentation/Subviews/CourseProgressView.swift +++ b/Course/Course/Presentation/Subviews/CourseProgressView.swift @@ -21,7 +21,7 @@ public struct CourseProgressView: View { ZStack(alignment: .leading) { GeometryReader { geometry in RoundedRectangle(cornerRadius: 10) - .fill(Theme.Colors.textSecondary.opacity(0.5)) + .fill(Theme.Colors.courseProgressGB) .frame(width: geometry.size.width, height: 10) if let total = progress.totalAssignmentsCount, diff --git a/Theme/Theme/Assets.xcassets/Colors/CourseProgressGB.colorset/Contents.json b/Theme/Theme/Assets.xcassets/Colors/CourseProgressGB.colorset/Contents.json new file mode 100644 index 000000000..0c6177c8c --- /dev/null +++ b/Theme/Theme/Assets.xcassets/Colors/CourseProgressGB.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "0.500", + "blue" : "0.733", + "green" : "0.647", + "red" : "0.592" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "0.500", + "blue" : "0.624", + "green" : "0.533", + "red" : "0.475" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Theme/Theme/SwiftGen/ThemeAssets.swift b/Theme/Theme/SwiftGen/ThemeAssets.swift index 90ca10246..8d99e9ae3 100644 --- a/Theme/Theme/SwiftGen/ThemeAssets.swift +++ b/Theme/Theme/SwiftGen/ThemeAssets.swift @@ -46,6 +46,7 @@ public enum ThemeAssets { public static let pastDueTimelineColor = ColorAsset(name: "pastDueTimelineColor") public static let primaryHeaderColor = ColorAsset(name: "primaryHeaderColor") public static let secondaryHeaderColor = ColorAsset(name: "secondaryHeaderColor") + public static let courseProgressGB = ColorAsset(name: "CourseProgressGB") public static let deleteAccountBG = ColorAsset(name: "DeleteAccountBG") public static let infoColor = ColorAsset(name: "InfoColor") public static let irreversibleAlert = ColorAsset(name: "IrreversibleAlert") diff --git a/Theme/Theme/Theme.swift b/Theme/Theme/Theme.swift index 336e4e603..a2611739f 100644 --- a/Theme/Theme/Theme.swift +++ b/Theme/Theme/Theme.swift @@ -76,6 +76,7 @@ public struct Theme { public private(set) static var courseCardShadow = ThemeAssets.courseCardShadow.swiftUIColor public private(set) static var courseCardBackground = ThemeAssets.courseCardBackground.swiftUIColor public private(set) static var deleteAccountBG = ThemeAssets.deleteAccountBG.swiftUIColor + public private(set) static var courseProgressGB = ThemeAssets.courseProgressGB.swiftUIColor public static func update( accentColor: Color = ThemeAssets.accentColor.swiftUIColor, From e83a3a561f65dab029d8f6c167bcc6e761edf8c4 Mon Sep 17 00:00:00 2001 From: Saeed Bashir Date: Mon, 7 Oct 2024 18:02:37 +0500 Subject: [PATCH 2/3] chore: apply text color to download icon and success 500 to checkmark --- Core/Core/View/Base/DownloadView.swift | 1 + .../Presentation/Subviews/CustomDisclosureGroup.swift | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Core/Core/View/Base/DownloadView.swift b/Core/Core/View/Base/DownloadView.swift index ede7c2912..928f7667b 100644 --- a/Core/Core/View/Base/DownloadView.swift +++ b/Core/Core/View/Base/DownloadView.swift @@ -23,6 +23,7 @@ public struct DownloadAvailableView: View { CoreAssets.startDownloading.swiftUIImage.renderingMode(.template) .resizable() .scaledToFit() + .foregroundColor(Theme.Colors.textPrimary) .frame(width: 24, height: 24) } .frame(width: 30, height: 30) diff --git a/Course/Course/Presentation/Subviews/CustomDisclosureGroup.swift b/Course/Course/Presentation/Subviews/CustomDisclosureGroup.swift index 9e607d454..86e9d777e 100644 --- a/Course/Course/Presentation/Subviews/CustomDisclosureGroup.swift +++ b/Course/Course/Presentation/Subviews/CustomDisclosureGroup.swift @@ -39,7 +39,8 @@ struct CustomDisclosureGroup: View { .rotationEffect(.degrees(expandedSections[chapter.id] ?? false ? -90 : 90)) .foregroundColor(Theme.Colors.textPrimary) if chapter.childs.allSatisfy({ $0.completion == 1 }) { - CoreAssets.finishedSequence.swiftUIImage + CoreAssets.finishedSequence.swiftUIImage.renderingMode(.template) + .foregroundColor(Theme.Colors.success) } Text(chapter.displayName) .font(Theme.Fonts.titleMedium) @@ -126,8 +127,9 @@ struct CustomDisclosureGroup: View { VStack(alignment: .leading) { HStack { if sequential.completion == 1 { - CoreAssets.finishedSequence.swiftUIImage + CoreAssets.finishedSequence.swiftUIImage.renderingMode(.template) .resizable() + .foregroundColor(Theme.Colors.success) .frame(width: 20, height: 20) } else { sequential.type.image From bea49d269c09f35b864f5a567cfefdae9ab4f582 Mon Sep 17 00:00:00 2001 From: Saeed Bashir Date: Fri, 11 Oct 2024 15:03:13 +0500 Subject: [PATCH 3/3] refactor: fix typo --- Course/Course/Presentation/Subviews/CourseProgressView.swift | 2 +- .../Contents.json | 0 Theme/Theme/SwiftGen/ThemeAssets.swift | 2 +- Theme/Theme/Theme.swift | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename Theme/Theme/Assets.xcassets/Colors/{CourseProgressGB.colorset => CourseProgressBG.colorset}/Contents.json (100%) diff --git a/Course/Course/Presentation/Subviews/CourseProgressView.swift b/Course/Course/Presentation/Subviews/CourseProgressView.swift index cbc66ebb3..1aaeaa7c1 100644 --- a/Course/Course/Presentation/Subviews/CourseProgressView.swift +++ b/Course/Course/Presentation/Subviews/CourseProgressView.swift @@ -21,7 +21,7 @@ public struct CourseProgressView: View { ZStack(alignment: .leading) { GeometryReader { geometry in RoundedRectangle(cornerRadius: 10) - .fill(Theme.Colors.courseProgressGB) + .fill(Theme.Colors.courseProgressBG) .frame(width: geometry.size.width, height: 10) if let total = progress.totalAssignmentsCount, diff --git a/Theme/Theme/Assets.xcassets/Colors/CourseProgressGB.colorset/Contents.json b/Theme/Theme/Assets.xcassets/Colors/CourseProgressBG.colorset/Contents.json similarity index 100% rename from Theme/Theme/Assets.xcassets/Colors/CourseProgressGB.colorset/Contents.json rename to Theme/Theme/Assets.xcassets/Colors/CourseProgressBG.colorset/Contents.json diff --git a/Theme/Theme/SwiftGen/ThemeAssets.swift b/Theme/Theme/SwiftGen/ThemeAssets.swift index 8d99e9ae3..b9d56d98e 100644 --- a/Theme/Theme/SwiftGen/ThemeAssets.swift +++ b/Theme/Theme/SwiftGen/ThemeAssets.swift @@ -46,7 +46,7 @@ public enum ThemeAssets { public static let pastDueTimelineColor = ColorAsset(name: "pastDueTimelineColor") public static let primaryHeaderColor = ColorAsset(name: "primaryHeaderColor") public static let secondaryHeaderColor = ColorAsset(name: "secondaryHeaderColor") - public static let courseProgressGB = ColorAsset(name: "CourseProgressGB") + public static let courseProgressBG = ColorAsset(name: "CourseProgressBG") public static let deleteAccountBG = ColorAsset(name: "DeleteAccountBG") public static let infoColor = ColorAsset(name: "InfoColor") public static let irreversibleAlert = ColorAsset(name: "IrreversibleAlert") diff --git a/Theme/Theme/Theme.swift b/Theme/Theme/Theme.swift index a2611739f..ab225a4fa 100644 --- a/Theme/Theme/Theme.swift +++ b/Theme/Theme/Theme.swift @@ -76,7 +76,7 @@ public struct Theme { public private(set) static var courseCardShadow = ThemeAssets.courseCardShadow.swiftUIColor public private(set) static var courseCardBackground = ThemeAssets.courseCardBackground.swiftUIColor public private(set) static var deleteAccountBG = ThemeAssets.deleteAccountBG.swiftUIColor - public private(set) static var courseProgressGB = ThemeAssets.courseProgressGB.swiftUIColor + public private(set) static var courseProgressBG = ThemeAssets.courseProgressBG.swiftUIColor public static func update( accentColor: Color = ThemeAssets.accentColor.swiftUIColor,