@@ -24,19 +24,50 @@ struct SectionBlock<Content: View>: View {
2424
2525enum PanelColors {
2626 static let backgroundTop = Color ( nsColor: . windowBackgroundColor)
27- static let backgroundBottom = Color ( red: 0.91 , green: 0.94 , blue: 0.98 )
28- static let surface = Color ( nsColor: . controlBackgroundColor) . opacity ( 0.86 )
29- static let elevatedSurface = Color ( nsColor: . windowBackgroundColor) . opacity ( 0.94 )
30- static let border = Color . primary. opacity ( 0.08 )
31- static let mutedBorder = Color . primary. opacity ( 0.05 )
27+ static let backgroundMid = Color (
28+ light: Color ( red: 0.96 , green: 0.98 , blue: 1.0 ) ,
29+ dark: Color ( red: 0.14 , green: 0.15 , blue: 0.17 )
30+ )
31+ static let backgroundBottom = Color (
32+ light: Color ( red: 0.91 , green: 0.94 , blue: 0.98 ) ,
33+ dark: Color ( red: 0.09 , green: 0.10 , blue: 0.12 )
34+ )
35+ static let surface = Color (
36+ light: Color ( nsColor: . controlBackgroundColor) . opacity ( 0.86 ) ,
37+ dark: Color ( red: 0.18 , green: 0.19 , blue: 0.21 ) . opacity ( 0.94 )
38+ )
39+ static let elevatedSurface = Color (
40+ light: Color ( nsColor: . windowBackgroundColor) . opacity ( 0.94 ) ,
41+ dark: Color ( red: 0.13 , green: 0.14 , blue: 0.16 ) . opacity ( 0.98 )
42+ )
43+ static let heroSurfaceStart = Color (
44+ light: Color ( nsColor: . controlBackgroundColor) . opacity ( 0.96 ) ,
45+ dark: Color ( red: 0.20 , green: 0.21 , blue: 0.23 )
46+ )
47+ static let heroSurfaceEnd = Color (
48+ light: Color ( red: 0.88 , green: 0.93 , blue: 1.0 ) . opacity ( 0.64 ) ,
49+ dark: Color ( red: 0.12 , green: 0.15 , blue: 0.18 )
50+ )
51+ static let softFill = Color (
52+ light: Color . primary. opacity ( 0.035 ) ,
53+ dark: Color . white. opacity ( 0.055 )
54+ )
55+ static let border = Color (
56+ light: Color . primary. opacity ( 0.08 ) ,
57+ dark: Color . white. opacity ( 0.10 )
58+ )
59+ static let mutedBorder = Color (
60+ light: Color . primary. opacity ( 0.05 ) ,
61+ dark: Color . white. opacity ( 0.07 )
62+ )
3263}
3364
3465struct PanelBackground : View {
3566 var body : some View {
3667 LinearGradient (
3768 colors: [
3869 PanelColors . backgroundTop,
39- Color ( red : 0.95 , green : 0.97 , blue : 0.99 ) ,
70+ PanelColors . backgroundMid ,
4071 PanelColors . backgroundBottom,
4172 ] ,
4273 startPoint: . top,
@@ -45,6 +76,20 @@ struct PanelBackground: View {
4576 }
4677}
4778
79+ extension Color {
80+ init ( light: Color , dark: Color ) {
81+ self . init ( nsColor: NSColor ( name: nil ) { appearance in
82+ let bestMatch = appearance. bestMatch ( from: [ . darkAqua, . aqua] )
83+ switch bestMatch {
84+ case . darkAqua:
85+ return NSColor ( dark)
86+ default :
87+ return NSColor ( light)
88+ }
89+ } )
90+ }
91+ }
92+
4893struct StatusPill : View {
4994 let text : String
5095 let color : Color
0 commit comments