feat(design): 应用明亮指标配色与不透明实色面板
This commit is contained in:
@@ -5,30 +5,30 @@
|
||||
"color": {
|
||||
"color-space": "srgb",
|
||||
"components": {
|
||||
"red": "0.180",
|
||||
"green": "0.430",
|
||||
"blue": "0.180",
|
||||
"red": "0.298039",
|
||||
"green": "0.533333",
|
||||
"blue": "0.180392",
|
||||
"alpha": "1.000"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"idiom": "universal",
|
||||
"color": {
|
||||
"color-space": "srgb",
|
||||
"components": {
|
||||
"red": "0.576471",
|
||||
"green": "0.831373",
|
||||
"blue": "0.356863",
|
||||
"alpha": "1.000"
|
||||
}
|
||||
},
|
||||
"appearances": [
|
||||
{
|
||||
"appearance": "luminosity",
|
||||
"value": "dark"
|
||||
}
|
||||
],
|
||||
"color": {
|
||||
"color-space": "srgb",
|
||||
"components": {
|
||||
"red": "0.500",
|
||||
"green": "0.850",
|
||||
"blue": "0.430",
|
||||
"alpha": "1.000"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"info": {
|
||||
|
||||
@@ -5,30 +5,30 @@
|
||||
"color": {
|
||||
"color-space": "srgb",
|
||||
"components": {
|
||||
"red": "0.000",
|
||||
"green": "0.370",
|
||||
"blue": "0.400",
|
||||
"red": "0.000000",
|
||||
"green": "0.545098",
|
||||
"blue": "0.513725",
|
||||
"alpha": "1.000"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"idiom": "universal",
|
||||
"color": {
|
||||
"color-space": "srgb",
|
||||
"components": {
|
||||
"red": "0.207843",
|
||||
"green": "0.839216",
|
||||
"blue": "0.741176",
|
||||
"alpha": "1.000"
|
||||
}
|
||||
},
|
||||
"appearances": [
|
||||
{
|
||||
"appearance": "luminosity",
|
||||
"value": "dark"
|
||||
}
|
||||
],
|
||||
"color": {
|
||||
"color-space": "srgb",
|
||||
"components": {
|
||||
"red": "0.250",
|
||||
"green": "0.850",
|
||||
"blue": "0.780",
|
||||
"alpha": "1.000"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"info": {
|
||||
|
||||
@@ -5,30 +5,30 @@
|
||||
"color": {
|
||||
"color-space": "srgb",
|
||||
"components": {
|
||||
"red": "0.600",
|
||||
"green": "0.300",
|
||||
"blue": "0.020",
|
||||
"red": "0.678431",
|
||||
"green": "0.427451",
|
||||
"blue": "0.050980",
|
||||
"alpha": "1.000"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"idiom": "universal",
|
||||
"color": {
|
||||
"color-space": "srgb",
|
||||
"components": {
|
||||
"red": "1.000000",
|
||||
"green": "0.756863",
|
||||
"blue": "0.352941",
|
||||
"alpha": "1.000"
|
||||
}
|
||||
},
|
||||
"appearances": [
|
||||
{
|
||||
"appearance": "luminosity",
|
||||
"value": "dark"
|
||||
}
|
||||
],
|
||||
"color": {
|
||||
"color-space": "srgb",
|
||||
"components": {
|
||||
"red": "1.000",
|
||||
"green": "0.670",
|
||||
"blue": "0.280",
|
||||
"alpha": "1.000"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"info": {
|
||||
|
||||
@@ -5,30 +5,30 @@
|
||||
"color": {
|
||||
"color-space": "srgb",
|
||||
"components": {
|
||||
"red": "0.480",
|
||||
"green": "0.220",
|
||||
"blue": "0.700",
|
||||
"red": "0.788235",
|
||||
"green": "0.247059",
|
||||
"blue": "0.470588",
|
||||
"alpha": "1.000"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"idiom": "universal",
|
||||
"color": {
|
||||
"color-space": "srgb",
|
||||
"components": {
|
||||
"red": "0.960784",
|
||||
"green": "0.427451",
|
||||
"blue": "0.650980",
|
||||
"alpha": "1.000"
|
||||
}
|
||||
},
|
||||
"appearances": [
|
||||
{
|
||||
"appearance": "luminosity",
|
||||
"value": "dark"
|
||||
}
|
||||
],
|
||||
"color": {
|
||||
"color-space": "srgb",
|
||||
"components": {
|
||||
"red": "0.760",
|
||||
"green": "0.550",
|
||||
"blue": "1.000",
|
||||
"alpha": "1.000"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"info": {
|
||||
|
||||
@@ -5,30 +5,30 @@
|
||||
"color": {
|
||||
"color-space": "srgb",
|
||||
"components": {
|
||||
"red": "0.250",
|
||||
"green": "0.320",
|
||||
"blue": "0.750",
|
||||
"red": "0.258824",
|
||||
"green": "0.407843",
|
||||
"blue": "0.835294",
|
||||
"alpha": "1.000"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"idiom": "universal",
|
||||
"color": {
|
||||
"color-space": "srgb",
|
||||
"components": {
|
||||
"red": "0.435294",
|
||||
"green": "0.627451",
|
||||
"blue": "1.000000",
|
||||
"alpha": "1.000"
|
||||
}
|
||||
},
|
||||
"appearances": [
|
||||
{
|
||||
"appearance": "luminosity",
|
||||
"value": "dark"
|
||||
}
|
||||
],
|
||||
"color": {
|
||||
"color-space": "srgb",
|
||||
"components": {
|
||||
"red": "0.550",
|
||||
"green": "0.640",
|
||||
"blue": "1.000",
|
||||
"alpha": "1.000"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"info": {
|
||||
|
||||
@@ -5,30 +5,30 @@
|
||||
"color": {
|
||||
"color-space": "srgb",
|
||||
"components": {
|
||||
"red": "0.000",
|
||||
"green": "0.380",
|
||||
"blue": "0.650",
|
||||
"red": "0.521569",
|
||||
"green": "0.329412",
|
||||
"blue": "0.784314",
|
||||
"alpha": "1.000"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"idiom": "universal",
|
||||
"color": {
|
||||
"color-space": "srgb",
|
||||
"components": {
|
||||
"red": "0.745098",
|
||||
"green": "0.541176",
|
||||
"blue": "1.000000",
|
||||
"alpha": "1.000"
|
||||
}
|
||||
},
|
||||
"appearances": [
|
||||
{
|
||||
"appearance": "luminosity",
|
||||
"value": "dark"
|
||||
}
|
||||
],
|
||||
"color": {
|
||||
"color-space": "srgb",
|
||||
"components": {
|
||||
"red": "0.350",
|
||||
"green": "0.720",
|
||||
"blue": "1.000",
|
||||
"alpha": "1.000"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"info": {
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"colors": [
|
||||
{
|
||||
"idiom": "universal",
|
||||
"color": {
|
||||
"color-space": "srgb",
|
||||
"components": {
|
||||
"red": "0.929412",
|
||||
"green": "0.941176",
|
||||
"blue": "0.960784",
|
||||
"alpha": "1.000"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"idiom": "universal",
|
||||
"color": {
|
||||
"color-space": "srgb",
|
||||
"components": {
|
||||
"red": "0.090196",
|
||||
"green": "0.101961",
|
||||
"blue": "0.129412",
|
||||
"alpha": "1.000"
|
||||
}
|
||||
},
|
||||
"appearances": [
|
||||
{
|
||||
"appearance": "luminosity",
|
||||
"value": "dark"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"info": {
|
||||
"author": "xcode",
|
||||
"version": 1
|
||||
}
|
||||
}
|
||||
@@ -5,30 +5,30 @@
|
||||
"color": {
|
||||
"color-space": "srgb",
|
||||
"components": {
|
||||
"red": "0.960",
|
||||
"green": "0.970",
|
||||
"blue": "0.990",
|
||||
"alpha": "0.680"
|
||||
"red": "0.980392",
|
||||
"green": "0.984314",
|
||||
"blue": "0.992157",
|
||||
"alpha": "1.000"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"idiom": "universal",
|
||||
"color": {
|
||||
"color-space": "srgb",
|
||||
"components": {
|
||||
"red": "0.133333",
|
||||
"green": "0.152941",
|
||||
"blue": "0.192157",
|
||||
"alpha": "1.000"
|
||||
}
|
||||
},
|
||||
"appearances": [
|
||||
{
|
||||
"appearance": "luminosity",
|
||||
"value": "dark"
|
||||
}
|
||||
],
|
||||
"color": {
|
||||
"color-space": "srgb",
|
||||
"components": {
|
||||
"red": "0.100",
|
||||
"green": "0.120",
|
||||
"blue": "0.160",
|
||||
"alpha": "0.680"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"info": {
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
"color": {
|
||||
"color-space": "srgb",
|
||||
"components": {
|
||||
"red": "0.620",
|
||||
"green": "0.340",
|
||||
"blue": "0.000",
|
||||
"red": "0.678431",
|
||||
"green": "0.427451",
|
||||
"blue": "0.050980",
|
||||
"alpha": "1.000"
|
||||
}
|
||||
}
|
||||
@@ -17,9 +17,9 @@
|
||||
"color": {
|
||||
"color-space": "srgb",
|
||||
"components": {
|
||||
"red": "1.000",
|
||||
"green": "0.760",
|
||||
"blue": "0.240",
|
||||
"red": "1.000000",
|
||||
"green": "0.756863",
|
||||
"blue": "0.352941",
|
||||
"alpha": "1.000"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
"color": {
|
||||
"color-space": "srgb",
|
||||
"components": {
|
||||
"red": "0.700",
|
||||
"green": "0.260",
|
||||
"blue": "0.000",
|
||||
"red": "0.678431",
|
||||
"green": "0.427451",
|
||||
"blue": "0.050980",
|
||||
"alpha": "1.000"
|
||||
}
|
||||
}
|
||||
@@ -17,9 +17,9 @@
|
||||
"color": {
|
||||
"color-space": "srgb",
|
||||
"components": {
|
||||
"red": "1.000",
|
||||
"green": "0.620",
|
||||
"blue": "0.200",
|
||||
"red": "1.000000",
|
||||
"green": "0.756863",
|
||||
"blue": "0.352941",
|
||||
"alpha": "1.000"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
"color": {
|
||||
"color-space": "srgb",
|
||||
"components": {
|
||||
"red": "0.700",
|
||||
"green": "0.040",
|
||||
"blue": "0.460",
|
||||
"red": "0.788235",
|
||||
"green": "0.247059",
|
||||
"blue": "0.470588",
|
||||
"alpha": "1.000"
|
||||
}
|
||||
}
|
||||
@@ -17,9 +17,9 @@
|
||||
"color": {
|
||||
"color-space": "srgb",
|
||||
"components": {
|
||||
"red": "1.000",
|
||||
"green": "0.400",
|
||||
"blue": "0.750",
|
||||
"red": "0.960784",
|
||||
"green": "0.427451",
|
||||
"blue": "0.650980",
|
||||
"alpha": "1.000"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -60,7 +60,7 @@ struct MenuPanelView: View {
|
||||
.onChange(of: snapshot.network?.map(\.identity)) { _, keys in
|
||||
if !selectedInterface.isEmpty && !(keys ?? []).contains(selectedInterface) { selectedInterface = "" }
|
||||
}
|
||||
.background(.ultraThinMaterial, in: .rect(cornerRadius: 18))
|
||||
.background(Color("PanelBackground"), in: .rect(cornerRadius: 18))
|
||||
.clipShape(.rect(cornerRadius: 18))
|
||||
.modifier(AppearanceStyle(preferences: preferences))
|
||||
}
|
||||
@@ -180,7 +180,7 @@ struct MenuPanelView: View {
|
||||
Text(verbatim: "\(item.name) · \(item.addresses.first(where: { !$0.contains(":") }) ?? item.addresses.first ?? "--")")
|
||||
.font(.system(size: 10)).lineLimit(1).minimumScaleFactor(0.8).textSelection(.enabled)
|
||||
} else { Text("panel.addressUnknown").foregroundStyle(.secondary) }
|
||||
PanelTrendChart(dates: networkDates, first: networkDownloads, second: networkUploads, color: Color("MetricNetwork"), secondColor: Color("SeriesUpload"), fixedScale: nil, firstLabel: "network.download", secondLabel: "network.upload", expectedInterval: chartInterval, boundaryDates: chartBoundaries, intervals: networkIntervals).id(selectedInterface)
|
||||
PanelTrendChart(dates: networkDates, first: networkDownloads, second: networkUploads, color: Color("MetricMemory"), secondColor: Color("SeriesUpload"), fixedScale: nil, firstLabel: "network.download", secondLabel: "network.upload", expectedInterval: chartInterval, boundaryDates: chartBoundaries, intervals: networkIntervals).id(selectedInterface)
|
||||
if !network.isEmpty && total(\.download) == nil { Text("panel.rateBaseline").foregroundStyle(.secondary) }
|
||||
HStack { line("network.received", network.isEmpty ? "--" : MetricFormat.bytes(network.reduce(0) { $0 + $1.received })); line("network.sent", network.isEmpty ? "--" : MetricFormat.bytes(network.reduce(0) { $0 + $1.sent })) }
|
||||
switch snapshot.networkPath {
|
||||
@@ -228,7 +228,7 @@ struct MenuPanelView: View {
|
||||
ResourceCard(title: "metric.disk", symbol: "internaldrive", color: Color("MetricDisk"), value: snapshot.disk.map { String(format: "%.0f / %.0f GB", Double($0.total - min($0.total, $0.available)) / 1_000_000_000, Double($0.total) / 1_000_000_000) } ?? "--") {
|
||||
|
||||
|
||||
PanelTrendChart(dates: samples.map(\.date), first: samples.map(\.read), second: samples.map(\.write), color: Color("MetricDisk"), secondColor: Color("MetricMemory"), fixedScale: nil, firstLabel: "disk.read", secondLabel: "disk.write", expectedInterval: chartInterval, boundaryDates: chartBoundaries, intervals: chartIntervals)
|
||||
PanelTrendChart(dates: samples.map(\.date), first: samples.map(\.read), second: samples.map(\.write), color: Color("MetricDisk"), secondColor: Color("MetricNetwork"), fixedScale: nil, firstLabel: "disk.read", secondLabel: "disk.write", expectedInterval: chartInterval, boundaryDates: chartBoundaries, intervals: chartIntervals)
|
||||
Text("disk.physicalIO").foregroundStyle(.secondary)
|
||||
HStack { line("disk.read", MetricFormat.rate(snapshot.diskIO?.read)); line("disk.write", MetricFormat.rate(snapshot.diskIO?.written)) }
|
||||
HStack { line("disk.remainingLife", MetricFormat.percent(snapshot.diskHealth?.remainingLife)); line("disk.powerOnHours", snapshot.diskHealth?.powerOnHours.map { "\($0) h" } ?? "--") }
|
||||
@@ -318,7 +318,7 @@ struct MenuPanelView: View {
|
||||
}
|
||||
.buttonStyle(PanelControlButtonStyle())
|
||||
.padding(4)
|
||||
.glassEffect(.regular, in: .capsule)
|
||||
.background(Color("PanelCard"), in: .capsule)
|
||||
}
|
||||
.controlSize(.small)
|
||||
.padding(.horizontal, 2).padding(.vertical, 0)
|
||||
|
||||
@@ -15,15 +15,8 @@ struct AnimatedMetricText: View {
|
||||
|
||||
struct PanelCardBackground: ViewModifier {
|
||||
let radius: CGFloat
|
||||
@Environment(\.accessibilityReduceTransparency) private var reduceTransparency
|
||||
|
||||
func body(content: Content) -> some View {
|
||||
content.background {
|
||||
if reduceTransparency {
|
||||
RoundedRectangle(cornerRadius: radius).fill(Color(nsColor: .windowBackgroundColor))
|
||||
} else {
|
||||
RoundedRectangle(cornerRadius: radius).fill(Color("PanelCard"))
|
||||
}
|
||||
}
|
||||
content.background(RoundedRectangle(cornerRadius: radius).fill(Color("PanelCard")))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user