AppState.swift 1001 B

12345678910111213141516171819202122232425262728293031
  1. import Foundation
  2. import Observation
  3. import SwiftUICore
  4. import UIKit
  5. @Observable class AppState {
  6. func trioBackgroundColor(for colorScheme: ColorScheme) -> LinearGradient {
  7. colorScheme == .dark
  8. ? LinearGradient(
  9. gradient: Gradient(colors: [Color.bgDarkBlue, Color.bgDarkerDarkBlue]),
  10. startPoint: .top,
  11. endPoint: .bottom
  12. )
  13. : LinearGradient(
  14. gradient: Gradient(colors: [Color.gray.opacity(0.1)]),
  15. startPoint: .top,
  16. endPoint: .bottom
  17. )
  18. }
  19. func configureTabBarAppearance() {
  20. let appearance = UITabBarAppearance()
  21. appearance.configureWithDefaultBackground()
  22. appearance.backgroundEffect = UIBlurEffect(style: .systemChromeMaterial)
  23. appearance.backgroundColor = UIColor.clear
  24. UITabBar.appearance().standardAppearance = appearance
  25. UITabBar.appearance().scrollEdgeAppearance = appearance
  26. }
  27. }