diff --git a/Core/Core/View/Base/AppReview/AppReviewView.swift b/Core/Core/View/Base/AppReview/AppReviewView.swift index 550e0a00f..993ae611c 100644 --- a/Core/Core/View/Base/AppReview/AppReviewView.swift +++ b/Core/Core/View/Base/AppReview/AppReviewView.swift @@ -92,7 +92,7 @@ public struct AppReviewView: View { if viewModel.feedback.isEmpty { Text(CoreLocalization.Review.better) .font(Theme.Fonts.bodyMedium) - .foregroundColor(Theme.Colors.textSecondary) + .foregroundColor(Theme.Colors.textInputPlaceholderColor) .padding(16) } } diff --git a/Core/Core/View/Base/FullScreenErrorView/FullScreenErrorView.swift b/Core/Core/View/Base/FullScreenErrorView/FullScreenErrorView.swift index a8d8a9b34..5da27720b 100644 --- a/Core/Core/View/Base/FullScreenErrorView/FullScreenErrorView.swift +++ b/Core/Core/View/Base/FullScreenErrorView/FullScreenErrorView.swift @@ -42,7 +42,7 @@ public struct FullScreenErrorView: View { image .resizable() .renderingMode(.template) - .foregroundStyle(Theme.Colors.textSecondary) + .foregroundStyle(Theme.Colors.emptyStateIconColor) .aspectRatio(contentMode: .fit) .frame(maxWidth: 72, maxHeight: 80) @@ -55,7 +55,7 @@ public struct FullScreenErrorView: View { .noInternetWithReload: CoreAssets.noWifi.swiftUIImage .renderingMode(.template) - .foregroundStyle(Theme.Colors.textSecondary) + .foregroundStyle(Theme.Colors.emptyStateIconColor) .scaledToFit() Text(CoreLocalization.Error.Internet.noInternetTitle) @@ -70,7 +70,7 @@ public struct FullScreenErrorView: View { case .generic: CoreAssets.notAvaliable.swiftUIImage .renderingMode(.template) - .foregroundStyle(Theme.Colors.textSecondary) + .foregroundStyle(Theme.Colors.emptyStateIconColor) .scaledToFit() Text(CoreLocalization.View.Snackbar.tryAgainBtn) diff --git a/Course/Course/Data/Model/Data_CourseProgressResponse.swift b/Course/Course/Data/Model/Data_CourseProgressResponse.swift index 1e3f1e336..2bf4f060a 100644 --- a/Course/Course/Data/Model/Data_CourseProgressResponse.swift +++ b/Course/Course/Data/Model/Data_CourseProgressResponse.swift @@ -376,17 +376,7 @@ public extension DataLayer.GradingPolicy { CourseProgressGradingPolicy( assignmentPolicies: assignmentPolicies.map { $0.domain }, gradeRange: gradeRange, - assignmentColors: assignmentColors ?? [ - "#D24242", - "#7B9645", - "#5A5AD8", - "#B0842C", - "#2E90C2", - "#D13F88", - "#36A17D", - "#AE5AD8", - "#3BA03B" - ] + assignmentColors: CourseProgressGradingPolicy.normalizedAssignmentColors(assignmentColors) ) } } diff --git a/Course/Course/Domain/Model/AssignmentCardStatus.swift b/Course/Course/Domain/Model/AssignmentCardStatus.swift index 67845c604..7f991c1eb 100644 --- a/Course/Course/Domain/Model/AssignmentCardStatus.swift +++ b/Course/Course/Domain/Model/AssignmentCardStatus.swift @@ -24,7 +24,7 @@ public enum AssignmentCardStatus: Sendable, Equatable { case .pastDue: return Theme.Colors.warning.opacity(0.1) case .notAvailable: - return Theme.Colors.textSecondary.opacity(0.1) + return Theme.Colors.cardViewStroke.opacity(0.1) } } @@ -37,7 +37,7 @@ public enum AssignmentCardStatus: Sendable, Equatable { case .pastDue: return Theme.Colors.warning case .notAvailable: - return Theme.Colors.textSecondary + return Theme.Colors.cardViewStroke } } diff --git a/Course/Course/Domain/Model/CourseProgressDetails.swift b/Course/Course/Domain/Model/CourseProgressDetails.swift index 067d6ca34..76e30d4a5 100644 --- a/Course/Course/Domain/Model/CourseProgressDetails.swift +++ b/Course/Course/Domain/Model/CourseProgressDetails.swift @@ -209,6 +209,18 @@ public struct CourseProgressGrade: Sendable { } public struct CourseProgressGradingPolicy: Sendable { + public static let defaultAssignmentColors = [ + "#D24242", + "#7B9645", + "#5A5AD8", + "#B0842C", + "#2E90C2", + "#D13F88", + "#36A17D", + "#AE5AD8", + "#3BA03B" + ] + public let assignmentPolicies: [CourseProgressAssignmentPolicy] public let gradeRange: [String: Double] public let assignmentColors: [String] @@ -220,7 +232,24 @@ public struct CourseProgressGradingPolicy: Sendable { ) { self.assignmentPolicies = assignmentPolicies self.gradeRange = gradeRange - self.assignmentColors = assignmentColors + self.assignmentColors = Self.normalizedAssignmentColors(assignmentColors) + } + + public static func normalizedAssignmentColors(_ assignmentColors: [String]?) -> [String] { + guard let assignmentColors, !assignmentColors.isEmpty else { + return defaultAssignmentColors + } + return assignmentColors + } + + public static func assignmentColorHex(for index: Int, in assignmentColors: [String]) -> String { + let colors = assignmentColors.isEmpty ? defaultAssignmentColors : assignmentColors + let colorIndex = max(0, index) % colors.count + return colors[colorIndex] + } + + public func assignmentColorHex(for index: Int) -> String { + Self.assignmentColorHex(for: index, in: assignmentColors) } } diff --git a/Course/Course/Presentation/Content/Elements/AssignmentDetailCardView.swift b/Course/Course/Presentation/Content/Elements/AssignmentDetailCardView.swift index 48c17f2c0..827f22ac1 100644 --- a/Course/Course/Presentation/Content/Elements/AssignmentDetailCardView.swift +++ b/Course/Course/Presentation/Content/Elements/AssignmentDetailCardView.swift @@ -36,7 +36,7 @@ struct AssignmentDetailCardView: View { case .pastDue: return Theme.Colors.warning case .notAvailable: - return Theme.Colors.textSecondary + return Theme.Colors.cardViewStroke default: return Theme.Colors.cardViewStroke } diff --git a/Course/Course/Presentation/Offline/Subviews/TotalDownloadedProgressView.swift b/Course/Course/Presentation/Offline/Subviews/TotalDownloadedProgressView.swift index 59bcd40b8..45bd4cd07 100644 --- a/Course/Course/Presentation/Offline/Subviews/TotalDownloadedProgressView.swift +++ b/Course/Course/Presentation/Offline/Subviews/TotalDownloadedProgressView.swift @@ -67,7 +67,7 @@ public struct TotalDownloadedProgressView: View { ZStack(alignment: .leading) { GeometryReader { geometry in RoundedRectangle(cornerRadius: 2.5) - .fill(Theme.Colors.textSecondary.opacity(0.5)) + .fill(Theme.Colors.courseProgressBG) .frame(width: geometry.size.width, height: 5) RoundedCorners(tl: 2.5, tr: 0, bl: 2.5, br: 0) diff --git a/Course/Course/Presentation/Progress/CourseProgressScreenView.swift b/Course/Course/Presentation/Progress/CourseProgressScreenView.swift index d5ab79476..c00a8022c 100644 --- a/Course/Course/Presentation/Progress/CourseProgressScreenView.swift +++ b/Course/Course/Presentation/Progress/CourseProgressScreenView.swift @@ -186,7 +186,7 @@ struct CourseProgressScreenView: View { VStack(spacing: 16) { Image(systemName: "doc.text") .font(.system(size: 48)) - .foregroundColor(Theme.Colors.textSecondary) + .foregroundColor(Theme.Colors.emptyStateIconColor) Text(CourseLocalization.CourseContainer.Progress.noGradedAssignments) .font(Theme.Fonts.titleMedium) diff --git a/Course/Course/Presentation/Progress/CourseProgressViewModel.swift b/Course/Course/Presentation/Progress/CourseProgressViewModel.swift index f7ace021e..9be1dbb43 100644 --- a/Course/Course/Presentation/Progress/CourseProgressViewModel.swift +++ b/Course/Course/Presentation/Progress/CourseProgressViewModel.swift @@ -157,18 +157,14 @@ public class CourseProgressViewModel { } public func getAssignmentColor(for index: Int) -> Color { - guard let courseProgress = courseProgress else { - return Theme.Colors.textSecondary - } - - if courseProgress.gradingPolicy.assignmentColors.isEmpty { - return Theme.Colors.accentColor - } + let hexColor = courseProgress?.gradingPolicy.assignmentColorHex(for: index) + ?? CourseProgressGradingPolicy.assignmentColorHex(for: index, in: []) - let colorIndex = index % courseProgress.gradingPolicy.assignmentColors.count - let hexColor = courseProgress.gradingPolicy.assignmentColors[colorIndex] + let fallbackHexColor = CourseProgressGradingPolicy.assignmentColorHex(for: index, in: []) - return Color(hex: hexColor) ?? Theme.Colors.accentColor + return Color(hex: hexColor) + ?? Color(hex: fallbackHexColor) + ?? Theme.Colors.assignmentColor } public func getAllAssignmentProgressData() -> [String: AssignmentProgressData] { diff --git a/Course/Course/Presentation/Progress/Elements/SegmentedProgressView.swift b/Course/Course/Presentation/Progress/Elements/SegmentedProgressView.swift index 820cf808d..c7e699ddc 100644 --- a/Course/Course/Presentation/Progress/Elements/SegmentedProgressView.swift +++ b/Course/Course/Presentation/Progress/Elements/SegmentedProgressView.swift @@ -168,14 +168,11 @@ extension SegmentedProgressView { percentGraded: 0.0 ) - let color: Color - if !assignmentColors.isEmpty { - let colorIndex = index % assignmentColors.count - let hexColor = assignmentColors[colorIndex] - color = Color(hex: hexColor) ?? Theme.Colors.textSecondary - } else { - color = Theme.Colors.textSecondary - } + let hexColor = CourseProgressGradingPolicy.assignmentColorHex(for: index, in: assignmentColors) + let fallbackHexColor = CourseProgressGradingPolicy.assignmentColorHex(for: index, in: []) + let color = Color(hex: hexColor) + ?? Color(hex: fallbackHexColor) + ?? Theme.Colors.assignmentColor let segment = ProgressSegment( progress: progressData.pointsPercentage, diff --git a/Course/Course/Presentation/Unit/Subviews/DropdownList/CourseUnitDropDownList.swift b/Course/Course/Presentation/Unit/Subviews/DropdownList/CourseUnitDropDownList.swift index d80a1f6a0..43113800c 100644 --- a/Course/Course/Presentation/Unit/Subviews/DropdownList/CourseUnitDropDownList.swift +++ b/Course/Course/Presentation/Unit/Subviews/DropdownList/CourseUnitDropDownList.swift @@ -36,7 +36,7 @@ struct CourseUnitDropDownList: View where Content: View { .background(Theme.Colors.background) .clipShape(RoundedRectangle(cornerRadius: 10)) .frame(height: scrollViewHeight) - .shadow(color: Theme.Colors.textSecondary, radius: 4) + .shadow(color: Theme.Colors.shadowColor, radius: 4) } } diff --git a/Course/Course/Presentation/Unit/Subviews/LessonProgressView.swift b/Course/Course/Presentation/Unit/Subviews/LessonProgressView.swift index 9573f825f..35a9730d9 100644 --- a/Course/Course/Presentation/Unit/Subviews/LessonProgressView.swift +++ b/Course/Course/Presentation/Unit/Subviews/LessonProgressView.swift @@ -34,7 +34,7 @@ struct LessonProgressView: View { .foregroundColor( selected == viewModel.selectedLesson() ? .accentColor - : Theme.Colors.textSecondary + : Theme.Colors.progressSkip ) } Spacer() diff --git a/Course/Course/Presentation/Video/SubtitlesView.swift b/Course/Course/Presentation/Video/SubtitlesView.swift index 37e7e242f..f5cba7043 100644 --- a/Course/Course/Presentation/Video/SubtitlesView.swift +++ b/Course/Course/Presentation/Video/SubtitlesView.swift @@ -73,7 +73,7 @@ public struct SubtitlesView: View { .multilineTextAlignment(.leading) .foregroundColor(subtitle.fromTo.contains(Date(milliseconds: currentTime)) ? Theme.Colors.textPrimary - : Theme.Colors.textSecondary) + : Theme.Colors.textTertiary) .onChange(of: currentTime, perform: { _ in if subtitle.fromTo.contains(Date(milliseconds: currentTime)) { diff --git a/Course/CourseTests/Presentation/Unit/CourseProgressViewModelTests.swift b/Course/CourseTests/Presentation/Unit/CourseProgressViewModelTests.swift index 4266c541b..4f74fe918 100644 --- a/Course/CourseTests/Presentation/Unit/CourseProgressViewModelTests.swift +++ b/Course/CourseTests/Presentation/Unit/CourseProgressViewModelTests.swift @@ -535,6 +535,28 @@ final class CourseProgressViewModelTests: XCTestCase { XCTAssertNotNil(allData["Exam"]) } + func testAssignmentColorsFallbackToDefaultPalette() { + XCTAssertEqual( + CourseProgressGradingPolicy.normalizedAssignmentColors(nil), + CourseProgressGradingPolicy.defaultAssignmentColors + ) + XCTAssertEqual( + CourseProgressGradingPolicy.normalizedAssignmentColors([]), + CourseProgressGradingPolicy.defaultAssignmentColors + ) + XCTAssertEqual( + CourseProgressGradingPolicy.assignmentColorHex(for: 9, in: []), + CourseProgressGradingPolicy.defaultAssignmentColors[0] + ) + + let gradingPolicy = CourseProgressGradingPolicy( + assignmentPolicies: [], + gradeRange: [:], + assignmentColors: [] + ) + XCTAssertEqual(gradingPolicy.assignmentColors, CourseProgressGradingPolicy.defaultAssignmentColors) + } + private func createMockCourseStructure(withDownloadableBlocks: Bool = false) -> CourseStructure { let block = CourseBlock( blockId: "block123", diff --git a/Dashboard/Dashboard/Presentation/Elements/NoCoursesView.swift b/Dashboard/Dashboard/Presentation/Elements/NoCoursesView.swift index 82a471509..2b5a82a28 100644 --- a/Dashboard/Dashboard/Presentation/Elements/NoCoursesView.swift +++ b/Dashboard/Dashboard/Presentation/Elements/NoCoursesView.swift @@ -68,7 +68,7 @@ struct NoCoursesView: View { CoreAssets.learnEmpty.swiftUIImage .resizable() .frame(width: 96, height: 96) - .foregroundStyle(Theme.Colors.textSecondaryLight) + .foregroundStyle(Theme.Colors.emptyStateIconColor) Text(type.title) .foregroundStyle(Theme.Colors.textPrimary) .font(Theme.Fonts.titleMedium) diff --git a/Discovery/Discovery/Presentation/NativeDiscovery/DiscoveryView.swift b/Discovery/Discovery/Presentation/NativeDiscovery/DiscoveryView.swift index 1b65966b7..82df2a8f1 100644 --- a/Discovery/Discovery/Presentation/NativeDiscovery/DiscoveryView.swift +++ b/Discovery/Discovery/Presentation/NativeDiscovery/DiscoveryView.swift @@ -55,12 +55,12 @@ public struct DiscoveryView: View { // MARK: - Search fake field HStack(spacing: 11) { Image(systemName: "magnifyingglass") - .foregroundColor(Theme.Colors.textSecondary) + .foregroundColor(Theme.Colors.textInputPlaceholderColor) .padding(.leading, 16) .padding(.top, 1) .accessibilityIdentifier("search_image") Text(DiscoveryLocalization.search) - .foregroundColor(Theme.Colors.textSecondary) + .foregroundColor(Theme.Colors.textInputPlaceholderColor) .accessibilityIdentifier("search_text") Spacer() } diff --git a/Downloads/Downloads/Presentation/AppDownloadsView.swift b/Downloads/Downloads/Presentation/AppDownloadsView.swift index 15e0c4ac9..ea1b9730a 100644 --- a/Downloads/Downloads/Presentation/AppDownloadsView.swift +++ b/Downloads/Downloads/Presentation/AppDownloadsView.swift @@ -192,7 +192,7 @@ public struct AppDownloadsView: View { CoreAssets.learnEmpty.swiftUIImage .resizable() .frame(width: 96, height: 96) - .foregroundStyle(Theme.Colors.textSecondaryLight) + .foregroundStyle(Theme.Colors.emptyStateIconColor) Text(DownloadsLocalization.Downloads.NoCoursesToDownload.title) .foregroundStyle(Theme.Colors.textPrimary) .font(Theme.Fonts.titleMedium) diff --git a/Downloads/Downloads/Presentation/Elements/DownloadCourseCell.swift b/Downloads/Downloads/Presentation/Elements/DownloadCourseCell.swift index 9e77cbc16..3580fe5f1 100644 --- a/Downloads/Downloads/Presentation/Elements/DownloadCourseCell.swift +++ b/Downloads/Downloads/Presentation/Elements/DownloadCourseCell.swift @@ -220,19 +220,19 @@ struct DownloadCourseCell: View { HStack { CoreAssets.startDownloading.swiftUIImage - .foregroundStyle(Theme.Colors.textSecondary) + .foregroundStyle(Theme.Colors.secondaryContentColor) Text(DownloadsLocalization.Downloads.Cell.available(availableFormatted)) .font(Theme.Fonts.labelLarge) - .foregroundStyle(Theme.Colors.textSecondary) + .foregroundStyle(Theme.Colors.secondaryContentColor) } } case .notDownloaded, .loadingStructure: HStack { CoreAssets.startDownloading.swiftUIImage - .foregroundStyle(Theme.Colors.textSecondary) + .foregroundStyle(Theme.Colors.secondaryContentColor) Text(DownloadsLocalization.Downloads.Cell.available(availableFormatted)) .font(Theme.Fonts.labelLarge) - .foregroundStyle(Theme.Colors.textSecondary) + .foregroundStyle(Theme.Colors.secondaryContentColor) } } } @@ -248,7 +248,7 @@ struct DownloadCourseCell: View { ZStack(alignment: .leading) { GeometryReader { geometry in RoundedRectangle(cornerRadius: 4) - .fill(Theme.Colors.textSecondary.opacity(0.5)) + .fill(Theme.Colors.courseProgressBG) .frame(width: geometry.size.width, height: 8) if progressPercentage > 0 { diff --git a/Profile/Profile/Presentation/DatesAndCalendar/CoursesToSyncView.swift b/Profile/Profile/Presentation/DatesAndCalendar/CoursesToSyncView.swift index cf546fb1c..ba3524e12 100644 --- a/Profile/Profile/Presentation/DatesAndCalendar/CoursesToSyncView.swift +++ b/Profile/Profile/Presentation/DatesAndCalendar/CoursesToSyncView.swift @@ -139,7 +139,7 @@ public struct CoursesToSyncView: View { CoreAssets.learnEmpty.swiftUIImage .resizable() .frame(width: 96, height: 96) - .foregroundStyle(Theme.Colors.textSecondaryLight) + .foregroundStyle(Theme.Colors.emptyStateIconColor) Text(ProfileLocalization.Sync.noSynced) .foregroundStyle(Theme.Colors.textPrimary) .font(Theme.Fonts.titleMedium) diff --git a/Profile/Profile/Presentation/DeleteAccount/DeleteAccountView.swift b/Profile/Profile/Presentation/DeleteAccount/DeleteAccountView.swift index a377632ab..af30b70a8 100644 --- a/Profile/Profile/Presentation/DeleteAccount/DeleteAccountView.swift +++ b/Profile/Profile/Presentation/DeleteAccount/DeleteAccountView.swift @@ -59,7 +59,7 @@ public struct DeleteAccountView: View { // MARK: Password Group { Text(ProfileLocalization.DeleteAccount.password) - .foregroundColor(Theme.Colors.textSecondary) + .foregroundColor(Theme.Colors.textPrimary) .font(Theme.Fonts.labelLarge) .multilineTextAlignment(.leading) .padding(.top, 16) diff --git a/Profile/Profile/Presentation/EditProfile/ProfileBottomSheet.swift b/Profile/Profile/Presentation/EditProfile/ProfileBottomSheet.swift index 54a3c7ff5..b04ccf01e 100644 --- a/Profile/Profile/Presentation/EditProfile/ProfileBottomSheet.swift +++ b/Profile/Profile/Presentation/EditProfile/ProfileBottomSheet.swift @@ -86,7 +86,7 @@ struct ProfileBottomSheet: View { VStack(alignment: .center, spacing: 4) { HStack(alignment: .center) { RoundedRectangle(cornerRadius: 2, style: .circular) - .foregroundColor(Theme.Colors.textSecondary) + .foregroundColor(Theme.Colors.secondaryContentColor) .frame(width: 31, height: 4) .padding(.top, 4) } diff --git a/Profile/Profile/Presentation/Profile/Subviews/ProfileSupportInfoView.swift b/Profile/Profile/Presentation/Profile/Subviews/ProfileSupportInfoView.swift index 799df753d..3b1acd60d 100644 --- a/Profile/Profile/Presentation/Profile/Subviews/ProfileSupportInfoView.swift +++ b/Profile/Profile/Presentation/Profile/Subviews/ProfileSupportInfoView.swift @@ -154,7 +154,7 @@ struct ProfileSupportInfoView: View { .accessibilityLabel(viewModel.title) Rectangle() .frame(height: 1) - .foregroundColor(Theme.Colors.textSecondary) + .foregroundColor(Theme.Colors.cardViewStroke) } @ViewBuilder @@ -198,7 +198,7 @@ struct ProfileSupportInfoView: View { .accessibilityIdentifier(identifier) Rectangle() .frame(height: 1) - .foregroundColor(Theme.Colors.textSecondary) + .foregroundColor(Theme.Colors.cardViewStroke) } @ViewBuilder diff --git a/Theme/Theme/Assets.xcassets/Colors/EmptyStateIconColor.colorset/Contents.json b/Theme/Theme/Assets.xcassets/Colors/EmptyStateIconColor.colorset/Contents.json new file mode 100644 index 000000000..b3032c958 --- /dev/null +++ b/Theme/Theme/Assets.xcassets/Colors/EmptyStateIconColor.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.392", + "green" : "0.286", + "red" : "0.239" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.682", + "green" : "0.608", + "red" : "0.557" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Theme/Theme/Assets.xcassets/Colors/SecondaryContentColor.colorset/Contents.json b/Theme/Theme/Assets.xcassets/Colors/SecondaryContentColor.colorset/Contents.json new file mode 100644 index 000000000..b3032c958 --- /dev/null +++ b/Theme/Theme/Assets.xcassets/Colors/SecondaryContentColor.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.392", + "green" : "0.286", + "red" : "0.239" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.682", + "green" : "0.608", + "red" : "0.557" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Theme/Theme/Assets.xcassets/Colors/TextColor/TextSecondary.colorset/Contents.json b/Theme/Theme/Assets.xcassets/Colors/TextColor/TextSecondary.colorset/Contents.json index 93691d3e8..b3032c958 100644 --- a/Theme/Theme/Assets.xcassets/Colors/TextColor/TextSecondary.colorset/Contents.json +++ b/Theme/Theme/Assets.xcassets/Colors/TextColor/TextSecondary.colorset/Contents.json @@ -5,9 +5,9 @@ "color-space" : "srgb", "components" : { "alpha" : "1.000", - "blue" : "0.733", - "green" : "0.647", - "red" : "0.592" + "blue" : "0.392", + "green" : "0.286", + "red" : "0.239" } }, "idiom" : "universal" @@ -23,9 +23,9 @@ "color-space" : "srgb", "components" : { "alpha" : "1.000", - "blue" : "0.624", - "green" : "0.533", - "red" : "0.475" + "blue" : "0.682", + "green" : "0.608", + "red" : "0.557" } }, "idiom" : "universal" diff --git a/Theme/Theme/Assets.xcassets/Colors/TextColor/TextSecondaryLight.colorset/Contents.json b/Theme/Theme/Assets.xcassets/Colors/TextColor/TextSecondaryLight.colorset/Contents.json index 93691d3e8..b3032c958 100644 --- a/Theme/Theme/Assets.xcassets/Colors/TextColor/TextSecondaryLight.colorset/Contents.json +++ b/Theme/Theme/Assets.xcassets/Colors/TextColor/TextSecondaryLight.colorset/Contents.json @@ -5,9 +5,9 @@ "color-space" : "srgb", "components" : { "alpha" : "1.000", - "blue" : "0.733", - "green" : "0.647", - "red" : "0.592" + "blue" : "0.392", + "green" : "0.286", + "red" : "0.239" } }, "idiom" : "universal" @@ -23,9 +23,9 @@ "color-space" : "srgb", "components" : { "alpha" : "1.000", - "blue" : "0.624", - "green" : "0.533", - "red" : "0.475" + "blue" : "0.682", + "green" : "0.608", + "red" : "0.557" } }, "idiom" : "universal" diff --git a/Theme/Theme/Assets.xcassets/Colors/TextColor/TextTertiary.colorset/Contents.json b/Theme/Theme/Assets.xcassets/Colors/TextColor/TextTertiary.colorset/Contents.json new file mode 100644 index 000000000..d0e7c2d04 --- /dev/null +++ b/Theme/Theme/Assets.xcassets/Colors/TextColor/TextTertiary.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.549", + "green" : "0.431", + "red" : "0.353" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.682", + "green" : "0.608", + "red" : "0.557" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Theme/Theme/SwiftGen/ThemeAssets.swift b/Theme/Theme/SwiftGen/ThemeAssets.swift index dfd504a01..669531e48 100644 --- a/Theme/Theme/SwiftGen/ThemeAssets.swift +++ b/Theme/Theme/SwiftGen/ThemeAssets.swift @@ -48,6 +48,7 @@ public enum ThemeAssets { public static let secondaryHeaderColor = ColorAsset(name: "secondaryHeaderColor") public static let courseProgressBG = ColorAsset(name: "CourseProgressBG") public static let deleteAccountBG = ColorAsset(name: "DeleteAccountBG") + public static let emptyStateIconColor = ColorAsset(name: "EmptyStateIconColor") public static let infoColor = ColorAsset(name: "InfoColor") public static let irreversibleAlert = ColorAsset(name: "IrreversibleAlert") public static let loginBackground = ColorAsset(name: "LoginBackground") @@ -65,6 +66,7 @@ public enum ThemeAssets { public static let secondaryButtonBGColor = ColorAsset(name: "SecondaryButtonBGColor") public static let secondaryButtonBorderColor = ColorAsset(name: "SecondaryButtonBorderColor") public static let secondaryButtonTextColor = ColorAsset(name: "SecondaryButtonTextColor") + public static let secondaryContentColor = ColorAsset(name: "SecondaryContentColor") public static let shadowColor = ColorAsset(name: "ShadowColor") public static let slidingSelectedTextColor = ColorAsset(name: "slidingSelectedTextColor") public static let slidingStrokeColor = ColorAsset(name: "slidingStrokeColor") @@ -85,6 +87,7 @@ public enum ThemeAssets { public static let textSecondary = ColorAsset(name: "TextSecondary") public static let textSecondaryDark = ColorAsset(name: "TextSecondaryDark") public static let textSecondaryLight = ColorAsset(name: "TextSecondaryLight") + public static let textTertiary = ColorAsset(name: "TextTertiary") public static let textInputBackground = ColorAsset(name: "TextInputBackground") public static let textInputPlaceholderColor = ColorAsset(name: "TextInputPlaceholderColor") public static let textInputStroke = ColorAsset(name: "TextInputStroke") diff --git a/Theme/Theme/Theme.swift b/Theme/Theme/Theme.swift index 35f705319..f77af6ea9 100644 --- a/Theme/Theme/Theme.swift +++ b/Theme/Theme/Theme.swift @@ -43,6 +43,7 @@ public struct Theme: Sendable { nonisolated(unsafe) public private(set) static var textSecondary = ThemeAssets.textSecondary.swiftUIColor nonisolated(unsafe) public private(set) static var textSecondaryLight = ThemeAssets.textSecondaryLight.swiftUIColor nonisolated(unsafe) public private(set) static var textSecondaryDark = ThemeAssets.textSecondaryDark.swiftUIColor + nonisolated(unsafe) public private(set) static var textTertiary = ThemeAssets.textTertiary.swiftUIColor nonisolated(unsafe) public private(set) static var textInputBackground = ThemeAssets.textInputBackground.swiftUIColor nonisolated(unsafe) public private(set) static var textInputStroke = ThemeAssets.textInputStroke.swiftUIColor nonisolated(unsafe) public private(set) static var textInputUnfocusedBackground = ThemeAssets.textInputUnfocusedBackground.swiftUIColor @@ -64,6 +65,7 @@ public struct Theme: Sendable { nonisolated(unsafe) public private(set) static var success = ThemeAssets.success.swiftUIColor nonisolated(unsafe) public private(set) static var primaryButtonTextColor = ThemeAssets.primaryButtonTextColor.swiftUIColor nonisolated(unsafe) public private(set) static var toggleSwitchColor = ThemeAssets.toggleSwitchColor.swiftUIColor + nonisolated(unsafe) public private(set) static var tabbarInactiveColor = ThemeAssets.tabbarInactiveColor.swiftUIColor nonisolated(unsafe) public private(set) static var textInputTextColor = ThemeAssets.textInputTextColor.swiftUIColor nonisolated(unsafe) public private(set) static var textInputPlaceholderColor = ThemeAssets.textInputPlaceholderColor.swiftUIColor nonisolated(unsafe) public private(set) static var infoColor = ThemeAssets.infoColor.swiftUIColor @@ -88,6 +90,8 @@ public struct Theme: Sendable { nonisolated(unsafe) public private(set) static var resumeButtonText = ThemeAssets.resumeButtonText.swiftUIColor nonisolated(unsafe) public private(set) static var socialAuthColor = ThemeAssets.socialAuthColor.swiftUIColor nonisolated(unsafe) public private(set) static var assignmentColor = ThemeAssets.assignmentStroke.swiftUIColor + nonisolated(unsafe) public private(set) static var emptyStateIconColor = ThemeAssets.emptyStateIconColor.swiftUIColor + nonisolated(unsafe) public private(set) static var secondaryContentColor = ThemeAssets.secondaryContentColor.swiftUIColor public static func update( accentColor: Color = ThemeAssets.accentColor.swiftUIColor, @@ -113,6 +117,7 @@ public struct Theme: Sendable { textPrimary: Color = ThemeAssets.textPrimary.swiftUIColor, textSecondary: Color = ThemeAssets.textSecondary.swiftUIColor, textSecondaryLight: Color = ThemeAssets.textSecondaryLight.swiftUIColor, + textTertiary: Color = ThemeAssets.textTertiary.swiftUIColor, textInputBackground: Color = ThemeAssets.textInputBackground.swiftUIColor, textInputStroke: Color = ThemeAssets.textInputStroke.swiftUIColor, textInputUnfocusedBackground: Color = ThemeAssets.textInputUnfocusedBackground.swiftUIColor, @@ -133,7 +138,9 @@ public struct Theme: Sendable { textInputTextColor: Color = ThemeAssets.textInputTextColor.swiftUIColor, textInputPlaceholderColor: Color = ThemeAssets.textInputPlaceholderColor.swiftUIColor, infoColor: Color = ThemeAssets.infoColor.swiftUIColor, - irreversibleAlert: Color = ThemeAssets.irreversibleAlert.swiftUIColor + irreversibleAlert: Color = ThemeAssets.irreversibleAlert.swiftUIColor, + emptyStateIconColor: Color = ThemeAssets.emptyStateIconColor.swiftUIColor, + secondaryContentColor: Color = ThemeAssets.secondaryContentColor.swiftUIColor ) { self.accentColor = accentColor self.accentXColor = accentXColor @@ -158,6 +165,7 @@ public struct Theme: Sendable { self.textPrimary = textPrimary self.textSecondary = textSecondary self.textSecondaryLight = textSecondaryLight + self.textTertiary = textTertiary self.textInputBackground = textInputBackground self.textInputStroke = textInputStroke self.textInputUnfocusedBackground = textInputUnfocusedBackground @@ -179,6 +187,8 @@ public struct Theme: Sendable { self.textInputPlaceholderColor = textInputPlaceholderColor self.infoColor = infoColor self.irreversibleAlert = irreversibleAlert + self.emptyStateIconColor = emptyStateIconColor + self.secondaryContentColor = secondaryContentColor } } // swiftlint:enable line_length diff --git a/WhatsNew/WhatsNew/Presentation/Elements/PageControl.swift b/WhatsNew/WhatsNew/Presentation/Elements/PageControl.swift index d7b3fe221..662751b34 100644 --- a/WhatsNew/WhatsNew/Presentation/Elements/PageControl.swift +++ b/WhatsNew/WhatsNew/Presentation/Elements/PageControl.swift @@ -31,7 +31,7 @@ public struct PageControl: View { ForEach(0 ..< numberOfPages) { page in RoundedRectangle(cornerRadius: 4) .frame(width: page == currentPage ? 24 : 8, height: 8) - .foregroundColor(page == currentPage ? Theme.Colors.accentXColor : Theme.Colors.textSecondaryLight) + .foregroundColor(page == currentPage ? Theme.Colors.accentXColor : Theme.Colors.tabbarInactiveColor) } } }