diff --git a/ResumeBuilder.xcodeproj/project.pbxproj b/ResumeBuilder.xcodeproj/project.pbxproj index 983beb5..1e0c36f 100644 --- a/ResumeBuilder.xcodeproj/project.pbxproj +++ b/ResumeBuilder.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 886AD6452AB9CD9100B1A00D /* ColorScheme+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 886AD6442AB9CD9100B1A00D /* ColorScheme+Extensions.swift */; }; E267D1742A8E0DE80069112B /* ResumeBuilderApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = E267D1732A8E0DE80069112B /* ResumeBuilderApp.swift */; }; E267D1762A8E0DE80069112B /* CV.swift in Sources */ = {isa = PBXBuildFile; fileRef = E267D1752A8E0DE80069112B /* CV.swift */; }; E267D1782A8E0DE90069112B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E267D1772A8E0DE90069112B /* Assets.xcassets */; }; @@ -41,6 +42,7 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 886AD6442AB9CD9100B1A00D /* ColorScheme+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ColorScheme+Extensions.swift"; sourceTree = ""; }; E2329BB12A9651E200A1270E /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; E267D1702A8E0DE80069112B /* ResumeBuilder.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ResumeBuilder.app; sourceTree = BUILT_PRODUCTS_DIR; }; E267D1732A8E0DE80069112B /* ResumeBuilderApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResumeBuilderApp.swift; sourceTree = ""; }; @@ -118,6 +120,7 @@ E267D17C2A8E0DE90069112B /* ResumeBuilder.entitlements */, E267D1792A8E0DE90069112B /* Preview Content */, E267D1822A8E0F320069112B /* Color+Extension.swift */, + 886AD6442AB9CD9100B1A00D /* ColorScheme+Extensions.swift */, E267D1932A8E38C60069112B /* Data.swift */, E267D1A52A8EC34B0069112B /* Data */, E267D1BE2A90095D0069112B /* Language */, @@ -230,7 +233,7 @@ attributes = { BuildIndependentTargetsInParallel = 1; LastSwiftUpdateCheck = 1430; - LastUpgradeCheck = 1430; + LastUpgradeCheck = 1500; TargetAttributes = { E267D16F2A8E0DE80069112B = { CreatedOnToolsVersion = 14.3.1; @@ -295,6 +298,7 @@ E267D18C2A8E1A890069112B /* TopViewImage.swift in Sources */, E267D19C2A8E45470069112B /* CareerStation.swift in Sources */, E267D1BA2A8F9D9C0069112B /* SkillStyle.swift in Sources */, + 886AD6452AB9CD9100B1A00D /* ColorScheme+Extensions.swift in Sources */, E267D1AD2A8F694A0069112B /* PublicationView.swift in Sources */, E267D1BC2A8FFF300069112B /* TagView.swift in Sources */, E267D1A02A8E45620069112B /* CVInfo.swift in Sources */, @@ -313,6 +317,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; @@ -342,9 +347,11 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -373,6 +380,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; @@ -402,9 +410,11 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -431,6 +441,7 @@ CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 1; + DEAD_CODE_STRIPPING = YES; DEVELOPMENT_ASSET_PATHS = "\"ResumeBuilder/Preview Content\""; DEVELOPMENT_TEAM = H8WR4M6QQ4; ENABLE_HARDENED_RUNTIME = YES; @@ -460,6 +471,7 @@ CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 1; + DEAD_CODE_STRIPPING = YES; DEVELOPMENT_ASSET_PATHS = "\"ResumeBuilder/Preview Content\""; DEVELOPMENT_TEAM = H8WR4M6QQ4; ENABLE_HARDENED_RUNTIME = YES; diff --git a/ResumeBuilder/CV.swift b/ResumeBuilder/CV.swift index d33447c..f99be59 100644 --- a/ResumeBuilder/CV.swift +++ b/ResumeBuilder/CV.swift @@ -1,6 +1,9 @@ import SwiftUI struct CV: View { + + @Environment(\.colorScheme) + var colorScheme: ColorScheme let info: CVInfo @@ -61,7 +64,7 @@ struct CV: View { Spacer(minLength: 0) Text(info.footer) .font(.footnote) - .foregroundColor(.secondary) + .foregroundColor(colorScheme.secondaryColor) } .padding() .aspectRatio(1 / sqrt(2), contentMode: .fit) diff --git a/ResumeBuilder/Color+Extension.swift b/ResumeBuilder/Color+Extension.swift index 2ed0d4d..c4a6f4a 100644 --- a/ResumeBuilder/Color+Extension.swift +++ b/ResumeBuilder/Color+Extension.swift @@ -13,4 +13,20 @@ extension Color { init(_ r: Double, _ g: Double, _ b: Double) { self.init(red: r, green: g, blue: b) } + + static var lightSchemePrimaryColor: Color { + .init(r: 1, g: 1, b: 1) + } + + static var darkSchemePrimaryColor: Color { + .init(r: 224, g: 224, b: 224) + } + + static var lightSchemeSecondaryColor: Color { + .init(r: 128, g: 128, b: 128) + } + + static var darkSchemeSecondaryColor: Color { + .init(r: 161, g: 161, b: 161) + } } diff --git a/ResumeBuilder/ColorScheme+Extensions.swift b/ResumeBuilder/ColorScheme+Extensions.swift new file mode 100644 index 0000000..238d3ce --- /dev/null +++ b/ResumeBuilder/ColorScheme+Extensions.swift @@ -0,0 +1,13 @@ +import Foundation +import SwiftUI + +extension ColorScheme { + + var primaryColor: Color { + self == .light ? .lightSchemePrimaryColor : .darkSchemePrimaryColor + } + + var secondaryColor: Color { + self == .light ? .lightSchemeSecondaryColor : .darkSchemeSecondaryColor + } +} diff --git a/ResumeBuilder/ContentView.swift b/ResumeBuilder/ContentView.swift index a4bd751..ca5002e 100644 --- a/ResumeBuilder/ContentView.swift +++ b/ResumeBuilder/ContentView.swift @@ -205,7 +205,7 @@ struct ContentView: View { private var renderContent: some View { CV(info: info, style: style) .frame(width: style.pageWidth, height: style.pageHeight) - .preferredColorScheme(.dark) + .preferredColorScheme(colorStyle) } @MainActor diff --git a/ResumeBuilder/Elements/CareerStationView.swift b/ResumeBuilder/Elements/CareerStationView.swift index 7a4dea4..6c3c1ec 100644 --- a/ResumeBuilder/Elements/CareerStationView.swift +++ b/ResumeBuilder/Elements/CareerStationView.swift @@ -3,6 +3,9 @@ import SFSafeSymbols struct CareerStationView: View { + @Environment(\.colorScheme) + var colorScheme: ColorScheme + let info: CareerStation let borderSpacing: CGFloat @@ -20,7 +23,7 @@ struct CareerStationView: View { RightImageLabel(info.location, systemSymbol: .house) } .font(.caption) - .foregroundColor(.secondary) + .foregroundColor(colorScheme.secondaryColor) Text(info.title) .font(.headline) .fontWeight(.regular) @@ -32,7 +35,7 @@ struct CareerStationView: View { if let text = info.text { Text(text) .font(.caption) - .foregroundColor(.secondary) + .foregroundColor(colorScheme.secondaryColor) } } } diff --git a/ResumeBuilder/Elements/PublicationView.swift b/ResumeBuilder/Elements/PublicationView.swift index 177c862..e75ac31 100644 --- a/ResumeBuilder/Elements/PublicationView.swift +++ b/ResumeBuilder/Elements/PublicationView.swift @@ -1,7 +1,10 @@ import SwiftUI struct PublicationView: View { - + + @Environment(\.colorScheme) + var colorScheme: ColorScheme + let info: Publication let borderSpacing: CGFloat @@ -15,10 +18,11 @@ struct PublicationView: View { VStack(alignment: .leading) { Text(info.venue) .font(.caption) - .foregroundColor(.secondary) + .foregroundColor(colorScheme.secondaryColor) Text(info.title) .font(.subheadline) .fontWeight(.regular) + .foregroundColor(colorScheme.primaryColor) } } } diff --git a/ResumeBuilder/Main Elements/TitledTextSection.swift b/ResumeBuilder/Main Elements/TitledTextSection.swift index 993dcf5..5a3a531 100644 --- a/ResumeBuilder/Main Elements/TitledTextSection.swift +++ b/ResumeBuilder/Main Elements/TitledTextSection.swift @@ -1,6 +1,9 @@ import SwiftUI struct TitledTextSection: View { + + @Environment(\.colorScheme) + var colorScheme: ColorScheme let content: Titled @@ -8,6 +11,10 @@ struct TitledTextSection: View { let paragraphSpacing: CGFloat + private var textColor: Color { + colorScheme == .light ? .lightSchemePrimaryColor : .darkSchemePrimaryColor + } + var body: some View { TitledSection(title: content.title, spacing: titleSpacing) { ForEach(content.items) { text in @@ -15,6 +22,7 @@ struct TitledTextSection: View { .font(.body) .fontWeight(.light) .padding(.bottom, paragraphSpacing) + .foregroundColor(textColor) } } }