// The chrome's two shadows.//// The Bear chrome's geometry (`docs/research/bear/geometry.md`, measured, not// preferred) lives in the theme's scale as its `chrome_*` keys, and a view reads// it from the WORN theme — `ContentMarginKnobs.chromeContentMargin` — never from a// static that reads the shipped one, so a database's theme reaches the chrome.importCoreGraphicsimportSwiftUI/// The two shadows. Shadow is physical darkness, not a theme slot, so the/// colour is black at an opacity rather than a palette role — which is also why/// the colour guard allows `.black` and nothing else. Their weights are the/// WORN theme's (`chrome_shadow_*` in its scale), read from the environment.privatestructSoftShadow: ViewModifier { @Environment(\.theme) privatevar themefunc body(content: Content) -> someView { content.shadow( color: .black.opacity(Double(MetricsKnobs.chromeShadowSoftOpacity)), radius: MetricsKnobs.chromeShadowSoftRadius, x: MetricsKnobs.chromeShadowSoftOffsetX, y: MetricsKnobs.chromeShadowSoftOffsetY ) }}/// A lifted row in `ReorderableList`.privatestructLiftShadow: ViewModifier { @Environment(\.theme) privatevar themelet opacity: Double?func body(content: Content) -> someView { content.shadow( color: .black.opacity(opacity ?? Double(MetricsKnobs.chromeShadowLiftOpacity)), radius: MetricsKnobs.chromeShadowLiftRadius, x: MetricsKnobs.chromeShadowLiftOffsetX, y: MetricsKnobs.chromeShadowLiftOffsetY ) }}extensionView {/// The nav-chrome shadow. A `radius` in SwiftUI is a blur radius the way/// `shadowRadius` is on the phone today, so the number carries across.publicfunc softShadow() -> someView { modifier(SoftShadow()) }/// The lifted-row shadow, whose OPACITY is what animates during a drag —/// the geometry stays fixed, because adding a shadow mid-gesture/// re-rasterizes the layer. Home's New thought pill wears it at rest, at/// its full weight (`opacity: nil`, the worn theme's): the one control on/// the page that floats above it.publicfunc liftShadow(opacity: Double? = nil) -> someView { modifier(LiftShadow(opacity: opacity)) }}/// The sizes, counts and timings Metrics draws with: Swift's own, beside/// their reader — a theme sets only its tokens (`scale.tokens`).enumMetricsKnobs {staticlet chromeShadowLiftOffsetX: CGFloat = 0staticlet chromeShadowLiftOffsetY: CGFloat = 6staticlet chromeShadowLiftOpacity: CGFloat = 0.16staticlet chromeShadowLiftRadius: CGFloat = 14staticlet chromeShadowSoftOffsetX: CGFloat = 0staticlet chromeShadowSoftOffsetY: CGFloat = 1staticlet chromeShadowSoftOpacity: CGFloat = 0.1staticlet chromeShadowSoftRadius: CGFloat = 5}