fix: removed "Based on cluster" from all colors list. It must be available only in Bar chart widget.

This commit is contained in:
Serhiy Mytrovtsiy
2022-08-12 19:33:52 +02:00
parent a2a4b93db4
commit 798f087378
2 changed files with 3 additions and 3 deletions

View File

@@ -17,7 +17,7 @@ public class BarChart: WidgetWrapper {
private var frameState: Bool = false
private var colorState: Color = .systemAccent
private var colors: [Color] = Color.allCases
private var colors: [Color] = [Color.cluster] + Color.allCases
private var value: [[ColorValue]] = [[]]
private var pressureLevel: DispatchSource.MemoryPressureEvent = .normal
private var colorZones: colorZones = (0.6, 0.8)
@@ -326,7 +326,7 @@ public class BarChart: WidgetWrapper {
guard let key = sender.representedObject as? String else {
return
}
if let newColor = Color.allCases.first(where: { $0.key == key }) {
if let newColor = self.colors.first(where: { $0.key == key }) {
self.colorState = newColor
}

View File

@@ -161,7 +161,7 @@ extension Color: CaseIterable {
} }
public static var allCases: [Color] {
return [.utilization, .pressure, .cluster, separator1,
return [.utilization, .pressure, separator1,
.systemAccent, .monochrome, separator2,
.clear, .white, .black, .gray, .secondGray, .darkGray, .lightGray,
.red, .secondRed, .green, .secondGreen, .blue, .secondBlue, .yellow, .secondYellow,