feat(menubar): 实现统一资源面板与独立滚动进程表
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import AppKit
|
||||
|
||||
@main struct PanelAssetChecks {
|
||||
static func main() {
|
||||
let bundle = Bundle(path: CommandLine.arguments[1])!
|
||||
for appearance in [NSAppearance.Name.aqua, .darkAqua] {
|
||||
NSAppearance(named: appearance)!.performAsCurrentDrawingAppearance {
|
||||
for name in ["PanelCard", "MetricCPU", "MetricGPU", "MetricMemory", "MetricNetwork", "MetricDisk", "MetricBattery"] {
|
||||
guard let color = NSColor(named: NSColor.Name(name), bundle: bundle)?.usingColorSpace(.sRGB) else { fatalError("Missing color: \(name)") }
|
||||
precondition(abs(color.alphaComponent - 1) < 0.001, "Transparent \(name)")
|
||||
if name == "MetricGPU" && appearance == .darkAqua { precondition(color.blueComponent > 0.99) }
|
||||
}
|
||||
}
|
||||
}
|
||||
print("PASS: compiled light/dark semantic colors exist, fully opaque, GPU blue component is normalized")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user