Просмотр исходного кода

Merge pull request #6 from dnzxy/UI

Improve gradient colors (thanks @tqb43), removed padding
polscm32 2 лет назад
Родитель
Сommit
797446b925

+ 2 - 1
FreeAPS/Sources/Modules/Home/View/Chart/MainChartView.swift

@@ -273,7 +273,7 @@ struct MainChartView: View {
         .scaleEffect(x: 1, y: -1)
         .frame(width: fullGlucoseWidth(viewWidth: fullSize.width) + additionalWidth(viewWidth: fullSize.width))
         .frame(maxHeight: Config.basalHeight)
-        .background(colorScheme == .dark ? Color.black.opacity(0.8) : Color.clear)
+        .background(Color.clear)
         .onChange(of: tempBasals) { _ in
             calculateBasalPoints(fullSize: fullSize)
         }
@@ -342,6 +342,7 @@ struct MainChartView: View {
             )
         }
     }
+
     // MARK: TO DO: CHANGE TIME LABELS TO ONLY DISPLAY EVERY SECOND LABEL WHEN SCREENHOURS IS TOO BIG
 
 //    private func timeLabelsView(fullSize: CGSize) -> some View {

+ 13 - 9
FreeAPS/Sources/Modules/Home/View/Header/CurrentGlucoseView.swift

@@ -11,13 +11,18 @@ struct CurrentGlucoseView: View {
 
     @State private var rotationDegrees: Double = 0.0
     @State private var angularGradient = AngularGradient(colors: [
-        Color(red: 0.729, green: 0.337, blue: 1),
-        Color(red: 0.263, green: 0.733, blue: 0.914),
-        Color(red: 0.263, green: 0.733, blue: 0.914),
-        Color(red: 0.263, green: 0.733, blue: 0.914),
-        Color(red: 0.263, green: 0.733, blue: 0.914),
-        Color(red: 0.729, green: 0.337, blue: 1)
-    ], center: .center, startAngle: .degrees(-55), endAngle: .degrees(145))
+        // 184, 87, 255
+        // 159, 108, 250
+        // 124, 139, 243
+        // 87, 170, 236
+        // 67, 187, 233
+        Color(red: 0.7215686275, green: 0.3411764706, blue: 1),
+        Color(red: 0.6235294118, green: 0.4235294118, blue: 0.9803921569),
+        Color(red: 0.4862745098, green: 0.5450980392, blue: 0.9529411765),
+        Color(red: 0.3411764706, green: 0.6666666667, blue: 0.9254901961),
+        Color(red: 0.262745098, green: 0.7333333333, blue: 0.9137254902),
+        Color(red: 0.7215686275, green: 0.3411764706, blue: 1)
+    ], center: .center, startAngle: .degrees(270), endAngle: .degrees(-90))
 
     @Environment(\.colorScheme) var colorScheme
 
@@ -57,8 +62,7 @@ struct CurrentGlucoseView: View {
     }
 
     var body: some View {
-//        let triangleColor = Color(red: 0.729, green: 0.337, blue: 1)
-        let triangleColor = Color(red: 0.263, green: 0.733, blue: 0.914)
+        let triangleColor = Color(red: 0.262745098, green: 0.7333333333, blue: 0.9137254902)
 
         ZStack {
             TrendShape(gradient: angularGradient, color: triangleColor)

+ 9 - 10
FreeAPS/Sources/Modules/Home/View/HomeRootView.swift

@@ -396,7 +396,6 @@ extension Home {
 
                     Group {
                         Circle().fill(Color.loopYellow).frame(width: 8, height: 8)
-                            .padding(.leading, 8)
                         Text("COB")
                             .font(.system(size: 12, weight: .bold)).foregroundColor(.loopYellow)
                     }
@@ -445,18 +444,18 @@ extension Home {
                             Color
                             .clear
                     )
-                    .shadow(
-                        color: colorScheme == .dark ? Color(
-                            red: 0.02745098039,
-                            green: 0.1098039216,
-                            blue: 0.1411764706
-                        ) : Color
-                            .black.opacity(0.33),
-                        radius: 3
-                    )
                     .cornerRadius(20)
                 }
             }
+            .shadow(
+                color: colorScheme == .dark ? Color(
+                    red: 0.02745098039,
+                    green: 0.1098039216,
+                    blue: 0.1411764706
+                ) : Color
+                    .black.opacity(0.33),
+                radius: 3
+            )
             .font(buttonFont)
         }