Skip to content

Allow static and dynamic colors based on BG range (inspired by Trio)#3

Merged
luborjurena merged 2 commits intodev-iob-contactfrom
dev-contact-colors
Jan 29, 2026
Merged

Allow static and dynamic colors based on BG range (inspired by Trio)#3
luborjurena merged 2 commits intodev-iob-contactfrom
dev-contact-colors

Conversation

@luborjurena
Copy link
Owner

screenshot

Allow selecting which contact to include Trend, Delta, or IOB into,
instead of only including into the BG contact. When a field is set
to "Separate", it becomes available as a target for other fields.
This enables groupings like BG+Trend in one contact and Delta+IOB
in another.
Adds a "Color Mode" setting with two options:
- Static: Uses the selected text color (existing behavior)
- Dynamic: Colors text based on BG range using raw mg/dL value
  - Green: In range
  - Yellow: High (>= highLine)
  - Red: Low (<= lowLine)

When Dynamic mode is selected, the text color picker is hidden since
the color is determined automatically based on glucose thresholds.

Files changed:
- ContactColorMode.swift: New enum with color logic
- Storage.swift: Add contactColorMode setting
- ContactSettingsViewModel.swift: Add colorMode property
- ContactSettingsView.swift: Add Color Mode picker
- ContactImageUpdater.swift: Use raw BG value for color calculation
- project.pbxproj: Add ContactColorMode.swift to project
@luborjurena luborjurena merged commit 906b8fe into dev-iob-contact Jan 29, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant