Add dynamic text contrast for mood colors and make theme preview full screen

- Add WCAG-compliant luminance calculation to Color extension
- Add contrastingTextColor method to MoodTints for automatic black/white text
- Update 12+ entry styles to use dynamic text colors instead of hardcoded white
- Change theme preview sheet to full screen presentation

Text now automatically switches between black and white based on background
brightness, fixing readability issues on light mood colors like yellow (Good).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Trey t
2025-12-29 10:31:31 -06:00
parent 2de96495e0
commit 51c5777c03
4 changed files with 63 additions and 20 deletions

View File

@@ -53,7 +53,12 @@ enum MoodTints: Int, CaseIterable {
return PastelTint.secondary(forMood: mood)
}
}
/// Returns black or white text color based on the mood's background luminance
func contrastingTextColor(forMood mood: Mood) -> Color {
color(forMood: mood).contrastingTextColor
}
var moodTints: MoodTintable.Type {
switch self {
case .Default: