LatestHRV.swift
1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//
// LatestHRV.swift
// hippo-watch Watch App
//
// Created by shihao on 2025/7/8.
//
import Foundation
import SwiftUI
struct LatestHRV: Codable {
var userHrv: Double?
var userHrvBaseline: Double?
var pairUserHrv: Double?
var pairHrvBaseline: Double?
}
extension HRVStressState {
var watchStatusColors: [Color] {
switch self {
case .energetic:
return [.init(hex: "#FF6EA271"),
.black]
case .normal:
return [.init(hex: "#FF796EA2"),
.black]
case .slightStress, .stressful:
return [.init(hex: "#FF924343"),
.black]
case .wait:
return [.black, .black]
}
}
var watchStatusTextColor: Color {
switch self {
case .energetic:
return .init(hex: "#FF95FF9B")
case .normal:
return .init(hex: "#FFE2BBFF")
case .slightStress, .stressful:
return .init(hex: "#FFFF8E8E")
case .wait:
return .init(hex: "#FFFF8E8E")
}
}
}