From 798f087378fbe3af514ab51567baec6ca1b5cd71 Mon Sep 17 00:00:00 2001 From: Serhiy Mytrovtsiy Date: Fri, 12 Aug 2022 19:33:52 +0200 Subject: [PATCH] fix: removed "Based on cluster" from all colors list. It must be available only in Bar chart widget. --- Kit/Widgets/BarChart.swift | 4 ++-- Kit/types.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Kit/Widgets/BarChart.swift b/Kit/Widgets/BarChart.swift index 55c0bcd4..46b400cd 100644 --- a/Kit/Widgets/BarChart.swift +++ b/Kit/Widgets/BarChart.swift @@ -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 } diff --git a/Kit/types.swift b/Kit/types.swift index f2f7c3f3..c06ca969 100644 --- a/Kit/types.swift +++ b/Kit/types.swift @@ -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,