Skip to content

Commit 851de30

Browse files
MarkHersheyclaude
andcommitted
Keep sunrise and sunset icons readable on any wallpaper
The icons were mixed toward a fixed mid-grey, which over a dark wallpaper is the same brightness as the light glass in front of it, so they all but disappeared. The arrow and horizon now use the secondary text colour, which flips with the glass like the text does, and only the sun keeps its orange or pink, deepened slightly toward the text colour. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 7166b0b commit 851de30

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

‎Sources/WorldClocks/Views/ClockRow.swift‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,17 @@ struct ClockRow: View {
183183
}
184184
}
185185

186+
/// The arrow and horizon use the secondary text colour, which always stands out from the glass behind,
187+
/// whatever the wallpaper. Only the sun carries colour, deepened slightly toward the text colour.
188+
/// (A fixed faded colour was the same brightness as grey glass over a dark wallpaper and vanished.)
189+
/// Single-layer symbols (the polar sun and moon) take the colour as a whole.
186190
private func sunLabel(_ symbol: String, _ color: Color, _ text: String) -> some View {
187-
HStack(alignment: .firstTextBaseline, spacing: 4) {
191+
let tint = AnyShapeStyle(color.mix(with: .primary, by: 0.2))
192+
return HStack(alignment: .firstTextBaseline, spacing: 4) {
188193
Image(systemName: symbol)
189-
.symbolRenderingMode(.hierarchical)
190-
// Faded toward grey (not transparency, which turns muddy on dark glass) so it doesn't compete with the weather icon.
191-
.foregroundStyle(color.mix(with: .gray, by: 0.45))
194+
.symbolRenderingMode(.palette)
195+
.foregroundStyle(symbol.hasPrefix("sunrise") || symbol.hasPrefix("sunset") ? AnyShapeStyle(.secondary) : tint,
196+
tint, AnyShapeStyle(.secondary))
192197
.fontWeight(.semibold)
193198
.modifier(IconSlot())
194199
column(text, template: "00h 00m")

0 commit comments

Comments
 (0)