Skip to content

Conversation

@graycreate
Copy link
Member

Summary

Improve tab bar icon contrast by adjusting the unselected item opacity from 40% to 60% for better visibility in both light and dark modes.

Changes

Color Adjustments

  • Light Mode:

    • Selected: Deep/dark color (unchanged)
    • Unselected: 60% opacity dark (was 40%) → better contrast
  • Dark Mode:

    • Selected: White (unchanged)
    • Unselected: 60% opacity white (was 40%) → better contrast

Benefits

  • ✨ Better visual distinction between selected and unselected tabs
  • 👁️ Improved readability with 60% opacity (more visible than 40%)
  • 🎨 Subtle difference (100% vs 60%) maintains clean, modern iOS aesthetic
  • ♿ Better accessibility with higher contrast ratios

Technical Details

  • Updated UITabBar.appearance().unselectedItemTintColor in MainPage init
  • Uses dynamic color that adapts to light/dark interface style
  • Applied to both standardAppearance and scrollEdgeAppearance

Testing

  • Build succeeds
  • App installed on Gray'iPhone
  • Verified tab bar colors in both light and dark modes
  • Confirmed better contrast with 60% opacity

Before vs After

Before: 40% opacity made unselected tabs too faint, hard to see at a glance
After: 60% opacity provides clear visual feedback while maintaining elegance

🤖 Generated with Claude Code

Update tab bar unselected item color from 40% to 60% opacity for better
contrast and visibility in both light and dark modes.

Changes:
- Light mode: selected uses dark color, unselected uses 60% opacity dark (was 40%)
- Dark mode: selected uses white, unselected uses 60% opacity white (was 40%)

The subtle difference (100% vs 60%) provides better visual feedback while
maintaining a clean, modern look consistent with iOS design patterns.

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

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings October 18, 2025 01:48
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves the visual accessibility of the tab bar by increasing the opacity of unselected tab items from 40% to 60% for better contrast in both light and dark modes. The change maintains the clean iOS aesthetic while making unselected tabs more visible to users.

Key Changes:

  • Added initialization code to configure UITabBar appearance
  • Increased unselected item opacity from 40% to 60% for better visibility
  • Implemented dynamic color adaptation for light and dark interface styles

Comment on lines 32 to 34
// Set tint color for selected items
// Light Mode: deep/dark color (from Color.tintColor)
// Dark Mode: white (from Color.tintColor)
Copy link

Copilot AI Oct 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider documenting what Color.tintColor represents or referencing it in the comment. The current comment mentions 'deep/dark color' and 'white' but doesn't clarify that this comes from the app's tint color configuration.

Suggested change
// Set tint color for selected items
// Light Mode: deep/dark color (from Color.tintColor)
// Dark Mode: white (from Color.tintColor)
// Set tint color for selected tab bar items.
// The color is taken from the app's tint color configuration (Color.tintColor).
// In Light Mode, this is typically a deep/dark color; in Dark Mode, it is typically white.

Copilot uses AI. Check for mistakes.
Comment on lines 40 to 49
let unselectedColor = UIColor { traitCollection in
switch traitCollection.userInterfaceStyle {
case .dark:
// Dark mode: slightly dimmed white (60% opacity for subtle difference)
return UIColor.white.withAlphaComponent(0.6)
default:
// Light mode: slightly lighter dark color (60% opacity for subtle difference)
return UIColor.black.withAlphaComponent(0.6)
}
}
Copy link

Copilot AI Oct 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider extracting the opacity value (0.6) as a named constant to make it easier to adjust and maintain consistency. For example: private static let unselectedTabOpacity: CGFloat = 0.6

Copilot uses AI. Check for mistakes.
@github-actions
Copy link

Code Coverage Report ❌

Current coverage: 0%

graycreate and others added 2 commits October 18, 2025 10:13
Fix tab bar colors by using proper SwiftUI approach instead of UIKit appearance APIs:
- Use .tint(Color.primary) for selected items (auto-adapts to light/dark mode)
- Set appearance.stackedLayoutAppearance for unselected text colors
- Remove UITabBar.appearance().tintColor to fix dark mode color reversal

Light mode: selected=black, unselected=light gray (78%)
Dark mode: selected=white, unselected=dim gray (60%)

Text colors now work correctly, icon colors need further fix.

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

Co-Authored-By: Claude <noreply@anthropic.com>
Simplify the tab bar color implementation:
- Use UITabBar.appearance().unselectedItemTintColor for unselected items (both icons and text)
- Use .accentColor(Color.primary) modifier on TabView for selected items
- Remove complex UITabBarAppearance layout configurations

This simpler approach should properly apply colors to both icons and text:
- Light mode: selected=black, unselected=light gray (78%)
- Dark mode: selected=white, unselected=dim gray (60%)

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

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions bot added size/S and removed size/S labels Oct 18, 2025
@github-actions
Copy link

Code Coverage Report ❌

Current coverage: 0%

@graycreate graycreate merged commit a969d5f into main Oct 18, 2025
5 of 6 checks passed
@graycreate graycreate deleted the feature/tabbar-light-dark-mode-colors branch October 18, 2025 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants