Skip to content

Commit

Permalink
change prognos -> xx label to systemPurple when dynamic colors used
Browse files Browse the repository at this point in the history
  • Loading branch information
dsnallfot committed Jun 17, 2024
1 parent a009b24 commit bf14ae6
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions LoopFollow/Controllers/Nightscout/DeviceStatus.swift
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,8 @@ extension MainViewController {
let eventualBGValue = eventualData["eventualBG"] as? NSNumber,
let loopYellow = UIColor(named: "LoopYellow"),
let loopRed = UIColor(named: "LoopRed"),
let loopGreen = UIColor(named: "LoopGreen") {
let loopGreen = UIColor(named: "LoopGreen")
{

let eventualBGFloatValue = eventualBGValue.floatValue // Convert NSNumber to Float

Expand All @@ -569,11 +570,17 @@ extension MainViewController {
latestEvBG = formattedBGString + " mmol/L"
sharedRawEvBG = formattedBGString
sharedLatestEvBG = latestEvBG

if eventualBGFloatValue >= UserDefaultsRepository.highLine.value {
PredictionLabel.text = " Prognos ⇢ \(formattedBGString)"
PredictionLabel.textColor = loopYellow
predictionColor = loopYellow
if UserDefaultsRepository.colorBGText.value {
PredictionLabel.text = " Prognos ⇢ \(formattedBGString)"
PredictionLabel.textColor = UIColor.systemPurple
predictionColor = UIColor.systemPurple
} else {
PredictionLabel.text = " Prognos ⇢ \(formattedBGString)"
PredictionLabel.textColor = loopYellow
predictionColor = loopYellow
}
} else if eventualBGFloatValue <= UserDefaultsRepository.lowLine.value {
PredictionLabel.text = " Prognos ⇢ \(formattedBGString)"
PredictionLabel.textColor = loopRed
Expand Down

0 comments on commit bf14ae6

Please sign in to comment.