aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI/macOS/View/ConfTextColorTheme.swift
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2019-01-22 01:19:16 +0530
committerRoopesh Chander <roop@roopc.net>2019-01-22 01:19:16 +0530
commit1bc21778833c2031d6f10819a9f19ff1d7a00648 (patch)
tree327bbf2393fc03c7fe1315755735ce280c44f363 /WireGuard/WireGuard/UI/macOS/View/ConfTextColorTheme.swift
parentmacOS: Refactor syntax highlighting (diff)
downloadwireguard-apple-1bc21778833c2031d6f10819a9f19ff1d7a00648.tar.xz
wireguard-apple-1bc21778833c2031d6f10819a9f19ff1d7a00648.zip
macOS: Reset attributes for each syntax highlight cycle
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'WireGuard/WireGuard/UI/macOS/View/ConfTextColorTheme.swift')
-rw-r--r--WireGuard/WireGuard/UI/macOS/View/ConfTextColorTheme.swift14
1 files changed, 12 insertions, 2 deletions
diff --git a/WireGuard/WireGuard/UI/macOS/View/ConfTextColorTheme.swift b/WireGuard/WireGuard/UI/macOS/View/ConfTextColorTheme.swift
index e633bdf..b258f8b 100644
--- a/WireGuard/WireGuard/UI/macOS/View/ConfTextColorTheme.swift
+++ b/WireGuard/WireGuard/UI/macOS/View/ConfTextColorTheme.swift
@@ -4,10 +4,16 @@
import Cocoa
protocol ConfTextColorTheme {
+ var defaultColor: NSColor { get }
+
func color(for: highlight_type) -> NSColor
}
struct ConfTextAquaColorTheme: ConfTextColorTheme {
+ var defaultColor: NSColor {
+ return NSColor(hex: "#000000") // Plain text in Xcode
+ }
+
func color(for highlightType: highlight_type) -> NSColor {
switch highlightType.rawValue {
case HighlightSection.rawValue:
@@ -27,12 +33,16 @@ struct ConfTextAquaColorTheme: ConfTextColorTheme {
case HighlightError.rawValue:
return NSColor(hex: "#C41A16") // Strings in Xcode
default:
- return NSColor(hex: "#000000") // Plain text in Xcode
+ return defaultColor
}
}
}
struct ConfTextDarkAquaColorTheme: ConfTextColorTheme {
+ var defaultColor: NSColor {
+ return NSColor(hex: "#FFFFFF") // Plain text in Xcode
+ }
+
func color(for highlightType: highlight_type) -> NSColor {
switch highlightType.rawValue {
case HighlightSection.rawValue:
@@ -52,7 +62,7 @@ struct ConfTextDarkAquaColorTheme: ConfTextColorTheme {
case HighlightError.rawValue:
return NSColor(hex: "#FF4C4C") // Strings in Xcode
default:
- return NSColor(hex: "#FFFFFF") // Plain text in Xcode
+ return defaultColor
}
}
}