From d5dac9f19629183c71de9487f9dcd7b11e424cb3 Mon Sep 17 00:00:00 2001 From: pranavharshith Date: Sat, 25 Jul 2026 20:05:06 +0530 Subject: [PATCH] Add monochrome theme (high-contrast white-on-black) --- bitchat/Localizable.xcstrings | 11 +++++++++++ bitchat/Utils/Theme.swift | 21 ++++++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/bitchat/Localizable.xcstrings b/bitchat/Localizable.xcstrings index a08f4ee8..950e472c 100644 --- a/bitchat/Localizable.xcstrings +++ b/bitchat/Localizable.xcstrings @@ -1172,6 +1172,17 @@ } } }, + "app_info.appearance.monochrome" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "monochrome" + } + } + } + }, "app_info.appearance.title" : { "extractionState" : "manual", "localizations" : { diff --git a/bitchat/Utils/Theme.swift b/bitchat/Utils/Theme.swift index 2f294201..ff78246a 100644 --- a/bitchat/Utils/Theme.swift +++ b/bitchat/Utils/Theme.swift @@ -16,6 +16,7 @@ enum AppTheme: String, CaseIterable, Identifiable { case dracula case solarizedDark case tokyoNight + case monochrome var id: String { rawValue } @@ -30,6 +31,7 @@ enum AppTheme: String, CaseIterable, Identifiable { case .dracula: return "app_info.appearance.dracula" case .solarizedDark: return "app_info.appearance.solarized_dark" case .tokyoNight: return "app_info.appearance.tokyo_night" + case .monochrome: return "app_info.appearance.monochrome" } } @@ -43,6 +45,7 @@ enum AppTheme: String, CaseIterable, Identifiable { case .dracula: return .monospaced case .solarizedDark: return .monospaced case .tokyoNight: return .default + case .monochrome: return .default } } @@ -51,7 +54,7 @@ enum AppTheme: String, CaseIterable, Identifiable { var usesGlassChrome: Bool { switch self { case .liquidGlass: return true - case .matrix, .nord, .dracula, .solarizedDark, .tokyoNight: return false + case .matrix, .nord, .dracula, .solarizedDark, .tokyoNight, .monochrome: return false } } @@ -66,6 +69,7 @@ enum AppTheme: String, CaseIterable, Identifiable { case .dracula: return "dc:" case .solarizedDark: return "sd:" case .tokyoNight: return "tn:" + case .monochrome: return "mc:" } } @@ -78,6 +82,7 @@ enum AppTheme: String, CaseIterable, Identifiable { case .dracula: return .dracula(colorScheme) case .solarizedDark: return .solarizedDark(colorScheme) case .tokyoNight: return .tokyoNight(colorScheme) + case .monochrome: return .monochrome(colorScheme) } } } @@ -186,6 +191,20 @@ struct ThemePalette { ) } + static func monochrome(_ colorScheme: ColorScheme) -> ThemePalette { + let isDark = colorScheme == .dark + return ThemePalette( + background: isDark ? .black : .white, + primary: isDark ? .white : .black, + secondary: isDark ? Color(white: 0.65) : Color(white: 0.40), + accent: isDark ? .white : .black, + locationAccent: isDark ? Color(white: 0.75) : Color(white: 0.25), + accentBlue: isDark ? Color(white: 0.75) : Color(white: 0.25), + alertRed: isDark ? Color(white: 0.55) : Color(white: 0.55), + divider: isDark ? Color(white: 0.25) : Color(white: 0.80) + ) + } + private static var systemBackground: Color { #if os(iOS) Color(UIColor.systemBackground)