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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user