commit f11973203ed96c7dd17653fc513d5769e22cc3b3
parent 37bd361e2f02119d23593d5a94562069ac501377
Author: Marc Stibane <marc@taler.net>
Date: Mon, 31 Aug 2026 19:46:48 +0200
fix color handling in dark mode
Diffstat:
4 files changed, 43 insertions(+), 43 deletions(-)
diff --git a/TalerCommon/Helper/WalletColors.swift b/TalerCommon/Helper/WalletColors.swift
@@ -72,7 +72,7 @@ public struct WalletColors {
prominent: Bool = false) -> Color {
disabled ? gray2
: !prominent ? primaryAccent
- : scheme == .dark ? primary(contrast)
+ : scheme == .dark ? Color("OnPrimary")
: pressed ? gray6 : Color.white
}
@@ -80,7 +80,7 @@ public struct WalletColors {
disabled: Bool,
prominent: Bool = false) -> Color {
disabled ? gray7
- : prominent ? primaryAccent
+ : prominent ? primaryAccent // == Taler
: pressed ? gray4 : gray5
}
@@ -145,11 +145,11 @@ public struct WalletColors {
func pendingColor(_ incoming: Bool) -> Color {
incoming ? primaryAccent // Color("PendingIncoming")
- : primary() // Color("PendingOutgoing")
+ : .primary // Color("PendingOutgoing")
}
func transactionColor(_ incoming: Bool) -> Color {
incoming ? primaryAccent // Color("Incoming")
- : primary() // Color("Outgoing")
+ : .primary // Color("Outgoing")
}
}
diff --git a/TalerWallet1/Resources/Assets.xcassets/OnPrimary.colorset/Contents.json b/TalerWallet1/Resources/Assets.xcassets/OnPrimary.colorset/Contents.json
@@ -0,0 +1,38 @@
+{
+ "colors" : [
+ {
+ "color" : {
+ "color-space" : "display-p3",
+ "components" : {
+ "alpha" : "1.000",
+ "blue" : "0xFF",
+ "green" : "0xFF",
+ "red" : "0xFF"
+ }
+ },
+ "idiom" : "universal"
+ },
+ {
+ "appearances" : [
+ {
+ "appearance" : "luminosity",
+ "value" : "dark"
+ }
+ ],
+ "color" : {
+ "color-space" : "display-p3",
+ "components" : {
+ "alpha" : "1.000",
+ "blue" : "0x78",
+ "green" : "0x2A",
+ "red" : "0x00"
+ }
+ },
+ "idiom" : "universal"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/TalerWallet1/Resources/Assets.xcassets/Primary.colorset/Contents.json b/TalerWallet1/Resources/Assets.xcassets/Primary.colorset/Contents.json
@@ -1,38 +0,0 @@
-{
- "colors" : [
- {
- "color" : {
- "color-space" : "display-p3",
- "components" : {
- "alpha" : "1.000",
- "blue" : "0",
- "green" : "0",
- "red" : "0"
- }
- },
- "idiom" : "universal"
- },
- {
- "appearances" : [
- {
- "appearance" : "luminosity",
- "value" : "dark"
- }
- ],
- "color" : {
- "color-space" : "display-p3",
- "components" : {
- "alpha" : "1.000",
- "blue" : "120",
- "green" : "42",
- "red" : "00"
- }
- },
- "idiom" : "universal"
- }
- ],
- "info" : {
- "author" : "xcode",
- "version" : 1
- }
-}
diff --git a/TalerWallet1/Views/Transactions/PaymentTransactionView.swift b/TalerWallet1/Views/Transactions/PaymentTransactionView.swift
@@ -55,7 +55,7 @@ struct MerchantHeader: View {
let merchant = terms.merchant.name
Text(merchant)
.talerFont(.title3)
- } .foregroundStyle(Color(.primary))
+ } .foregroundStyle(Color.primary)
.task {
if let imageBase64 = terms.merchant.logo {
image = Image(imageBase64: imageBase64)