Skip to content

Commit b355a3a

Browse files
authored
Rework the app colors for upgrade icons (#1158)
- Restore the default accent, but extend it to toggles on iOS - Keep the "gold" color for the upgrade icon - Replace the upgrade icon with the universally understandable lock icon
1 parent 9145200 commit b355a3a

File tree

19 files changed

+60
-62
lines changed

19 files changed

+60
-62
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
//
2+
// Color+Extensions.swift
3+
// Passepartout
4+
//
5+
// Created by Davide De Rosa on 2/10/25.
6+
// Copyright (c) 2025 Davide De Rosa. All rights reserved.
7+
//
8+
// https://github.com/passepartoutvpn
9+
//
10+
// This file is part of Passepartout.
11+
//
12+
// Passepartout is free software: you can redistribute it and/or modify
13+
// it under the terms of the GNU General Public License as published by
14+
// the Free Software Foundation, either version 3 of the License, or
15+
// (at your option) any later version.
16+
//
17+
// Passepartout is distributed in the hope that it will be useful,
18+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
19+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20+
// GNU General Public License for more details.
21+
//
22+
// You should have received a copy of the GNU General Public License
23+
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
24+
//
25+
26+
import SwiftUI
27+
28+
extension Color {
29+
public init(hex: UInt32) {
30+
self.init(
31+
red: Double((hex >> 16) & 0xff) / 255.0,
32+
green: Double((hex >> 8) & 0xff) / 255.0,
33+
blue: Double(hex & 0xff) / 255.0
34+
)
35+
}
36+
}

Packages/App/Sources/UILibrary/L10n/SwiftGen+Strings.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -757,8 +757,8 @@ public enum Strings {
757757
public static func connect(_ p1: Int) -> String {
758758
return Strings.tr("Localizable", "views.paywall.alerts.confirmation.message.connect", p1, fallback: "You may test the connection for %d minutes.")
759759
}
760-
/// Tap the upgrade icons to unlock the features.
761-
public static let save = Strings.tr("Localizable", "views.paywall.alerts.confirmation.message.save", fallback: "Tap the upgrade icons to unlock the features.")
760+
/// Tap the lock icons to purchase the missing features.
761+
public static let save = Strings.tr("Localizable", "views.paywall.alerts.confirmation.message.save", fallback: "Tap the lock icons to purchase the missing features.")
762762
}
763763
}
764764
public enum Pending {

Packages/App/Sources/UILibrary/Resources/de.lproj/Localizable.strings

+1-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@
251251
"views.paywall.alerts.confirmation.edit_profile" = "Profil bearbeiten";
252252
"views.paywall.alerts.confirmation.message" = "Dieses Profil erfordert kostenpflichtige Funktionen, um zu funktionieren.";
253253
"views.paywall.alerts.confirmation.message.connect" = "Sie können die Verbindung für %d Minuten testen.";
254-
"views.paywall.alerts.confirmation.message.save" = "Tippen Sie auf die Upgrade-Symbole, um die Funktionen freizuschalten.";
254+
"views.paywall.alerts.confirmation.message.save" = "Tippen Sie auf die Schlosssymbole, um die fehlenden Funktionen zu kaufen.";
255255
"views.paywall.alerts.confirmation.title" = "Kauf erforderlich";
256256
"views.paywall.alerts.pending.message" = "Der Kauf wartet auf eine externe Bestätigung. Die Funktion wird nach Genehmigung gutgeschrieben.";
257257
"views.paywall.alerts.restricted.message" = "Einige Funktionen sind in dieser Version nicht verfügbar.";

Packages/App/Sources/UILibrary/Resources/el.lproj/Localizable.strings

+1-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@
251251
"views.paywall.alerts.confirmation.edit_profile" = "Επεξεργασία προφίλ";
252252
"views.paywall.alerts.confirmation.message" = "Αυτό το προφίλ απαιτεί επί πληρωμή λειτουργίες για να λειτουργήσει.";
253253
"views.paywall.alerts.confirmation.message.connect" = "Μπορείτε να δοκιμάσετε τη σύνδεση για %d λεπτά.";
254-
"views.paywall.alerts.confirmation.message.save" = "Πατήστε στα εικονίδια αναβάθμισης για να ξεκλειδώσετε τις λειτουργίες.";
254+
"views.paywall.alerts.confirmation.message.save" = "Πατήστε στα εικονίδια κλειδώματος για να αγοράσετε τις ελλείπουσες λειτουργίες.";
255255
"views.paywall.alerts.confirmation.title" = "Απαιτείται αγορά";
256256
"views.paywall.alerts.pending.message" = "Η αγορά εκκρεμεί για εξωτερική επιβεβαίωση. Η λειτουργία θα πιστωθεί μετά την έγκριση.";
257257
"views.paywall.alerts.restricted.message" = "Ορισμένες λειτουργίες δεν είναι διαθέσιμες σε αυτήν την έκδοση.";

Packages/App/Sources/UILibrary/Resources/en.lproj/Localizable.strings

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
"views.paywall.alerts.confirmation.title" = "Purchase required";
8888
"views.paywall.alerts.confirmation.message" = "This profile requires paid features to work.";
8989
"views.paywall.alerts.confirmation.message.connect" = "You may test the connection for %d minutes.";
90-
"views.paywall.alerts.confirmation.message.save" = "Tap the upgrade icons to unlock the features.";
90+
"views.paywall.alerts.confirmation.message.save" = "Tap the lock icons to purchase the missing features.";
9191
"views.paywall.alerts.confirmation.edit_profile" = "Edit profile";
9292
"views.paywall.alerts.verification.connect.1" = "Your purchases are being verified.";
9393
"views.paywall.alerts.verification.connect.2" = "If verification cannot be completed, the connection will end in %d minutes.";

Packages/App/Sources/UILibrary/Resources/es.lproj/Localizable.strings

+1-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@
251251
"views.paywall.alerts.confirmation.edit_profile" = "Editar perfil";
252252
"views.paywall.alerts.confirmation.message" = "Este perfil requiere características de pago para funcionar.";
253253
"views.paywall.alerts.confirmation.message.connect" = "Puedes probar la conexión durante %d minutos.";
254-
"views.paywall.alerts.confirmation.message.save" = "Toca los iconos de actualización para desbloquear las funciones.";
254+
"views.paywall.alerts.confirmation.message.save" = "Toca los iconos de candado para comprar las funciones faltantes.";
255255
"views.paywall.alerts.confirmation.title" = "Compra requerida";
256256
"views.paywall.alerts.pending.message" = "La compra está pendiente de confirmación externa. La característica será acreditada tras la aprobación.";
257257
"views.paywall.alerts.restricted.message" = "Algunas características no están disponibles en esta versión.";

Packages/App/Sources/UILibrary/Resources/fr.lproj/Localizable.strings

+1-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@
251251
"views.paywall.alerts.confirmation.edit_profile" = "Modifier le profil";
252252
"views.paywall.alerts.confirmation.message" = "Ce profil nécessite des fonctionnalités payantes pour fonctionner.";
253253
"views.paywall.alerts.confirmation.message.connect" = "Vous pouvez tester la connexion pendant %d minutes.";
254-
"views.paywall.alerts.confirmation.message.save" = "Touchez les icônes de mise à niveau pour débloquer les fonctionnalités.";
254+
"views.paywall.alerts.confirmation.message.save" = "Touchez les icônes de cadenas pour acheter les fonctionnalités manquantes.";
255255
"views.paywall.alerts.confirmation.title" = "Achat requis";
256256
"views.paywall.alerts.pending.message" = "L'achat est en attente de confirmation externe. La fonctionnalité sera créditée une fois approuvée.";
257257
"views.paywall.alerts.restricted.message" = "Certaines fonctionnalités ne sont pas disponibles dans cette version.";

Packages/App/Sources/UILibrary/Resources/it.lproj/Localizable.strings

+1-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@
251251
"views.paywall.alerts.confirmation.edit_profile" = "Modifica profilo";
252252
"views.paywall.alerts.confirmation.message" = "Questo profilo richiede funzionalità a pagamento per funzionare.";
253253
"views.paywall.alerts.confirmation.message.connect" = "Puoi provare la connessione per %d minuti.";
254-
"views.paywall.alerts.confirmation.message.save" = "Tocca le icone di aggiornamento per sbloccare le funzionalità.";
254+
"views.paywall.alerts.confirmation.message.save" = "Tocca le icone del lucchetto per acquistare le funzionalità mancanti.";
255255
"views.paywall.alerts.confirmation.title" = "Acquisto richiesto";
256256
"views.paywall.alerts.pending.message" = "L'acquisto è in attesa di conferma esterna. La funzionalità verrà accreditata dopo l'approvazione.";
257257
"views.paywall.alerts.restricted.message" = "Alcune funzionalità non sono disponibili in questa versione.";

Packages/App/Sources/UILibrary/Resources/nl.lproj/Localizable.strings

+1-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@
251251
"views.paywall.alerts.confirmation.edit_profile" = "Profiel bewerken";
252252
"views.paywall.alerts.confirmation.message" = "Dit profiel vereist betaalde functies om te werken.";
253253
"views.paywall.alerts.confirmation.message.connect" = "Je kunt de verbinding %d minuten testen.";
254-
"views.paywall.alerts.confirmation.message.save" = "Tik op de upgrade-iconen om de functies te ontgrendelen.";
254+
"views.paywall.alerts.confirmation.message.save" = "Tik op de slotpictogrammen om de ontbrekende functies te kopen.";
255255
"views.paywall.alerts.confirmation.title" = "Aankoop vereist";
256256
"views.paywall.alerts.pending.message" = "De aankoop wacht op externe bevestiging. De functie wordt na goedkeuring gecrediteerd.";
257257
"views.paywall.alerts.restricted.message" = "Sommige functies zijn niet beschikbaar in deze versie.";

Packages/App/Sources/UILibrary/Resources/pl.lproj/Localizable.strings

+1-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@
251251
"views.paywall.alerts.confirmation.edit_profile" = "Edytuj profil";
252252
"views.paywall.alerts.confirmation.message" = "Ten profil wymaga płatnych funkcji do działania.";
253253
"views.paywall.alerts.confirmation.message.connect" = "Możesz przetestować połączenie przez %d minut.";
254-
"views.paywall.alerts.confirmation.message.save" = "Stuknij ikony aktualizacji, aby odblokować funkcje.";
254+
"views.paywall.alerts.confirmation.message.save" = "Stuknij ikony kłódki, aby kupić brakujące funkcje.";
255255
"views.paywall.alerts.confirmation.title" = "Wymagana zakup";
256256
"views.paywall.alerts.pending.message" = "Zakup oczekuje na zewnętrzne potwierdzenie. Funkcja zostanie przypisana po zatwierdzeniu.";
257257
"views.paywall.alerts.restricted.message" = "Niektóre funkcje są niedostępne w tej wersji.";

Packages/App/Sources/UILibrary/Resources/pt.lproj/Localizable.strings

+1-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@
251251
"views.paywall.alerts.confirmation.edit_profile" = "Editar perfil";
252252
"views.paywall.alerts.confirmation.message" = "Este perfil requer recursos pagos para funcionar.";
253253
"views.paywall.alerts.confirmation.message.connect" = "Você pode testar a conexão por %d minutos.";
254-
"views.paywall.alerts.confirmation.message.save" = "Toque nos ícones de atualização para desbloquear os recursos.";
254+
"views.paywall.alerts.confirmation.message.save" = "Toque nos ícones de cadeado para comprar os recursos ausentes.";
255255
"views.paywall.alerts.confirmation.title" = "Compra necessária";
256256
"views.paywall.alerts.pending.message" = "A compra está pendente de confirmação externa. O recurso será creditado após a aprovação.";
257257
"views.paywall.alerts.restricted.message" = "Alguns recursos estão indisponíveis nesta versão.";

Packages/App/Sources/UILibrary/Resources/ru.lproj/Localizable.strings

+1-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@
251251
"views.paywall.alerts.confirmation.edit_profile" = "Редактировать профиль";
252252
"views.paywall.alerts.confirmation.message" = "Этот профиль требует платных функций для работы.";
253253
"views.paywall.alerts.confirmation.message.connect" = "Вы можете протестировать подключение в течение %d минут.";
254-
"views.paywall.alerts.confirmation.message.save" = "Нажмите на значки обновления, чтобы разблокировать функции.";
254+
"views.paywall.alerts.confirmation.message.save" = "Нажмите на значки замка, чтобы приобрести недостающие функции.";
255255
"views.paywall.alerts.confirmation.title" = "Требуется покупка";
256256
"views.paywall.alerts.pending.message" = "Покупка ожидает внешнего подтверждения. Функция будет активирована после одобрения.";
257257
"views.paywall.alerts.restricted.message" = "Некоторые функции недоступны в этой версии.";

Packages/App/Sources/UILibrary/Resources/sv.lproj/Localizable.strings

+1-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@
251251
"views.paywall.alerts.confirmation.edit_profile" = "Redigera profil";
252252
"views.paywall.alerts.confirmation.message" = "Den här profilen kräver betalda funktioner för att fungera.";
253253
"views.paywall.alerts.confirmation.message.connect" = "Du kan testa anslutningen i %d minuter.";
254-
"views.paywall.alerts.confirmation.message.save" = "Tryck på uppgraderingsikonerna för att låsa upp funktionerna.";
254+
"views.paywall.alerts.confirmation.message.save" = "Tryck på låsikonerna för att köpa de saknade funktionerna.";
255255
"views.paywall.alerts.confirmation.title" = "Köp krävs";
256256
"views.paywall.alerts.pending.message" = "Köpet väntar på extern bekräftelse. Funktionen aktiveras efter godkännande.";
257257
"views.paywall.alerts.restricted.message" = "Vissa funktioner är inte tillgängliga i denna version.";

Packages/App/Sources/UILibrary/Resources/uk.lproj/Localizable.strings

+1-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@
251251
"views.paywall.alerts.confirmation.edit_profile" = "Редагувати профіль";
252252
"views.paywall.alerts.confirmation.message" = "Цей профіль потребує платних функцій для роботи.";
253253
"views.paywall.alerts.confirmation.message.connect" = "Ви можете протестувати підключення протягом %d хвилин.";
254-
"views.paywall.alerts.confirmation.message.save" = "Торкніться значків оновлення, щоб розблокувати функції.";
254+
"views.paywall.alerts.confirmation.message.save" = "Торкніться значків замка, щоб придбати відсутні функції.";
255255
"views.paywall.alerts.confirmation.title" = "Потрібна покупка";
256256
"views.paywall.alerts.pending.message" = "Покупка очікує зовнішнього підтвердження. Функція буде увімкнена після схвалення.";
257257
"views.paywall.alerts.restricted.message" = "Деякі функції недоступні в цій версії.";

Packages/App/Sources/UILibrary/Resources/zh-Hans.lproj/Localizable.strings

+1-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@
251251
"views.paywall.alerts.confirmation.edit_profile" = "编辑配置文件";
252252
"views.paywall.alerts.confirmation.message" = "此配置文件需要付费功能才能工作。";
253253
"views.paywall.alerts.confirmation.message.connect" = "您可以试用连接 %d 分钟。";
254-
"views.paywall.alerts.confirmation.message.save" = "点击升级图标以解锁功能。";
254+
"views.paywall.alerts.confirmation.message.save" = "点击锁定图标以购买缺失的功能。";
255255
"views.paywall.alerts.confirmation.title" = "需要购买";
256256
"views.paywall.alerts.pending.message" = "购买正在等待外部确认。功能将在获得批准后被授予。";
257257
"views.paywall.alerts.restricted.message" = "某些功能在此版本中不可用。";

Packages/App/Sources/UILibrary/Theme/Theme+ImageName.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ extension Theme.ImageName {
137137
}
138138
case .tvOn: return "tv"
139139
case .undisclose: return "chevron.up"
140-
case .upgrade: return "arrow.up.circle"
140+
case .upgrade: return "lock"
141141
case .warning: return "exclamationmark.triangle"
142142
}
143143
}

Packages/App/Sources/UILibrary/Theme/Theme.swift

+6-12
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,9 @@ public final class Theme: ObservableObject {
5454

5555
public internal(set) var emptyMessageColor: Color = .secondary
5656

57-
public internal(set) var primaryColor = Color(
58-
red: Double(0x51) / 255.0,
59-
green: Double(0x5D) / 255.0,
60-
blue: Double(0x70) / 255.0
61-
)
62-
63-
public internal(set) var activeColor = Color(
64-
red: .zero,
65-
green: Double(0xAA) / 255.0,
66-
blue: .zero
67-
)
57+
public internal(set) var primaryColor = Color(hex: 0xd69c68)
58+
59+
public internal(set) var activeColor = Color(hex: 0x00aa00)
6860

6961
public internal(set) var inactiveColor: Color = .secondary
7062

@@ -80,7 +72,9 @@ public final class Theme: ObservableObject {
8072
errorColor
8173
}
8274

83-
public internal(set) var upgradeColor: Color = .orange
75+
public var upgradeColor: Color {
76+
primaryColor
77+
}
8478

8579
public internal(set) var logoImage = "Logo"
8680

Packages/App/Sources/UILibrary/Views/UI/PurchaseRequiredView.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,9 @@ public struct PurchaseRequiredImage: View {
147147
ThemeImage(.upgrade)
148148
.foregroundStyle(theme.upgradeColor)
149149
.help(Strings.Views.Ui.PurchaseRequired.Purchase.help)
150-
#if os(macOS)
151150
.imageScale(.large)
151+
#if os(iOS)
152+
.padding(.leading, 4)
152153
#endif
153154
}
154155
}

Passepartout/App/Assets.xcassets/AccentColor.colorset/Contents.json

-33
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,7 @@
11
{
22
"colors" : [
33
{
4-
"color" : {
5-
"color-space" : "srgb",
6-
"components" : {
7-
"alpha" : "1.000",
8-
"blue" : "0x68",
9-
"green" : "0x9C",
10-
"red" : "0xD6"
11-
}
12-
},
134
"idiom" : "iphone"
14-
},
15-
{
16-
"color" : {
17-
"color-space" : "srgb",
18-
"components" : {
19-
"alpha" : "1.000",
20-
"blue" : "0x68",
21-
"green" : "0x9C",
22-
"red" : "0xD6"
23-
}
24-
},
25-
"idiom" : "ipad"
26-
},
27-
{
28-
"color" : {
29-
"color-space" : "srgb",
30-
"components" : {
31-
"alpha" : "1.000",
32-
"blue" : "0x68",
33-
"green" : "0x9C",
34-
"red" : "0xD6"
35-
}
36-
},
37-
"idiom" : "mac"
385
}
396
],
407
"info" : {

0 commit comments

Comments
 (0)