Extract the exercise info view and ready the figure palette and app icon for macOS
This commit is contained in:
@@ -6,6 +6,9 @@
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
#if canImport(AppKit)
|
||||
import AppKit
|
||||
#endif
|
||||
|
||||
/// The looping animated stick-figure for the run screen's bottom half, rendered with
|
||||
/// `Canvas` + `TimelineView(.animation)` from the bundled anatomical rig data (see
|
||||
@@ -255,6 +258,12 @@ private extension Color {
|
||||
static func figure(light: (Double, Double, Double), dark: (Double, Double, Double)) -> Color {
|
||||
#if os(watchOS)
|
||||
Color(red: dark.0, green: dark.1, blue: dark.2)
|
||||
#elseif os(macOS)
|
||||
Color(nsColor: NSColor(name: nil) { appearance in
|
||||
appearance.bestMatch(from: [.aqua, .darkAqua]) == .darkAqua
|
||||
? NSColor(red: dark.0, green: dark.1, blue: dark.2, alpha: 1)
|
||||
: NSColor(red: light.0, green: light.1, blue: light.2, alpha: 1)
|
||||
})
|
||||
#else
|
||||
Color(UIColor { traits in
|
||||
traits.userInterfaceStyle == .dark
|
||||
@@ -301,6 +310,8 @@ private extension Color {
|
||||
/// Opaque head fill — the screen background, so limbs pass behind the face.
|
||||
#if os(watchOS)
|
||||
static let figureHeadFill = Color.black
|
||||
#elseif os(macOS)
|
||||
static let figureHeadFill = Color(nsColor: .windowBackgroundColor)
|
||||
#else
|
||||
static let figureHeadFill = Color(.systemBackground)
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user