From 41f8a22a210bc7a0ff634c09ab05f7e1b8dcf3e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Rodriguez=20V=C3=A9lez?= Date: Wed, 20 Nov 2024 02:57:42 -0400 Subject: [PATCH] FIX: colors were hard to read --- ios/Widgets/PriceWidget/CompactPriceView.swift | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/ios/Widgets/PriceWidget/CompactPriceView.swift b/ios/Widgets/PriceWidget/CompactPriceView.swift index 0f519a197..5c6db03f9 100644 --- a/ios/Widgets/PriceWidget/CompactPriceView.swift +++ b/ios/Widgets/PriceWidget/CompactPriceView.swift @@ -2,6 +2,8 @@ import SwiftUI @available(iOS 15.0, *) struct CompactPriceView: View { + @Environment(\.colorScheme) var colorScheme + let price: String let lastUpdated: String let code: String @@ -12,14 +14,16 @@ struct CompactPriceView: View { Text(price) .font(.title) .bold() + .foregroundColor(priceTextColor) + .shadow(color: Color.black.opacity(0.2), radius: 1, x: 0, y: 1) .multilineTextAlignment(.center) .dynamicTypeSize(.large ... .accessibility5) .accessibilityLabel("Bitcoin price: \(price)") VStack(alignment: .center, spacing: 8) { - Text("\(code)") - Text("\(lastUpdated)") - Text("\(dataSource)") + Text(code) + Text(lastUpdated) + Text(dataSource) } .font(.subheadline) .foregroundColor(.secondary) @@ -29,4 +33,9 @@ struct CompactPriceView: View { .padding() .frame(maxWidth: .infinity) } + + // Adaptive color for the price text using system built-in colors + var priceTextColor: Color { + colorScheme == .dark ? .cyan : .blue + } }