feat(healthchat): paint the subtle gradient in brand blue

This commit is contained in:
Sedat Qaja
2026-10-20 13:22:42 +02:00
parent 3b7ed0a48b
commit a71145d904
2 changed files with 22 additions and 0 deletions
@@ -28,6 +28,7 @@ struct HealthChatCompoundHook: CompoundHookProtocol {
\.textActionAccent,
\.textLinkExternal,
\.borderInteractivePrimary,
\.borderAccentPrimary,
\.textBadgeAccent
]
let solidUIColorTokens: [KeyPath<CompoundUIColorTokens, UIColor> & Sendable] = [
@@ -39,6 +40,7 @@ struct HealthChatCompoundHook: CompoundHookProtocol {
\.textActionAccent,
\.textLinkExternal,
\.borderInteractivePrimary,
\.borderAccentPrimary,
\.textBadgeAccent
]
for keyPath in solidColorTokens {
@@ -63,6 +65,19 @@ struct HealthChatCompoundHook: CompoundHookProtocol {
colors.override(keyPath, with: Color(brand))
}
// Subtle gradient (home screen bloom, highlighted timeline item) → brand blue fading out,
// at the opacities Compound uses for its green stops. Stop 6 stays transparent.
let subtleGradientTokens: [KeyPath<CompoundColorTokens, Color>] = [
\.gradientSubtleStop1,
\.gradientSubtleStop2,
\.gradientSubtleStop3,
\.gradientSubtleStop4,
\.gradientSubtleStop5
]
for (keyPath, opacity) in zip(subtleGradientTokens, [0.41, 0.23, 0.11, 0.06, 0.03]) {
colors.override(keyPath, with: Color(brand).opacity(opacity))
}
// Subtle accent backgrounds (paired with accent-coloured foregrounds) → brand tint.
let tintColorTokens: [KeyPath<CompoundColorTokens, Color>] = [
\.bgAccentSelected,