소스 검색

Increase offset for high glucose, so in-range glucose is green-ish for longer

Deniz Cengiz 1 년 전
부모
커밋
b0e3ff8068
2개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 1
      FreeAPS/Sources/Helpers/DynamicGlucoseColor.swift
  2. 2 2
      FreeAPS/Sources/Modules/Home/View/Chart/MainChartView.swift

+ 1 - 1
FreeAPS/Sources/Helpers/DynamicGlucoseColor.swift

@@ -13,7 +13,7 @@ public func getDynamicGlucoseColor(
 ) -> Color {
     // Convert Decimal to Int for high and low glucose values
     let lowGlucose = lowGlucoseColorValue - offset
-    let highGlucose = highGlucoseColorValue + offset
+    let highGlucose = highGlucoseColorValue + (offset * 1.75)
     let targetGlucose = targetGlucose
 
     // Only use calculateHueBasedGlucoseColor if the setting is enabled in preferences

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

@@ -1229,8 +1229,8 @@ extension MainChartView {
         // Ensure maxForecast is not more than 100 over maxGlucose
         let adjustedMaxForecast = min(maxForecast, maxGlucose + 100)
 
-        var minOverall = min(minGlucose, minForecast)
-        var maxOverall = max(maxGlucose, adjustedMaxForecast)
+        let minOverall = min(minGlucose, minForecast)
+        let maxOverall = max(maxGlucose, adjustedMaxForecast)
 
         minValue = minOverall - 50
         maxValue = maxOverall + 80