diff options
Diffstat (limited to 'WireGuard/WireGuard/UI/macOS/View/ConfTextColorTheme.swift')
-rw-r--r-- | WireGuard/WireGuard/UI/macOS/View/ConfTextColorTheme.swift | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/WireGuard/WireGuard/UI/macOS/View/ConfTextColorTheme.swift b/WireGuard/WireGuard/UI/macOS/View/ConfTextColorTheme.swift new file mode 100644 index 0000000..e633bdf --- /dev/null +++ b/WireGuard/WireGuard/UI/macOS/View/ConfTextColorTheme.swift @@ -0,0 +1,58 @@ +// SPDX-License-Identifier: MIT +// Copyright © 2018-2019 WireGuard LLC. All Rights Reserved. + +import Cocoa + +protocol ConfTextColorTheme { + func color(for: highlight_type) -> NSColor +} + +struct ConfTextAquaColorTheme: ConfTextColorTheme { + func color(for highlightType: highlight_type) -> NSColor { + switch highlightType.rawValue { + case HighlightSection.rawValue: + return NSColor(hex: "#326D74") // Class name in Xcode + case HighlightField.rawValue: + return NSColor(hex: "#9B2393") // Keywords in Xcode + case HighlightPublicKey.rawValue, HighlightPrivateKey.rawValue, HighlightPresharedKey.rawValue: + return NSColor(hex: "#643820") // Preprocessor directives in Xcode + case HighlightIP.rawValue, HighlightHost.rawValue: + return NSColor(hex: "#0E0EFF") // URLs in Xcode + case HighlightCidr.rawValue, HighlightPort.rawValue: + return NSColor(hex: "#815F03") // Attributes in Xcode + case HighlightMTU.rawValue, HighlightKeepalive.rawValue: + return NSColor(hex: "#1C00CF") // Numbers in Xcode + case HighlightComment.rawValue: + return NSColor(hex: "#536579") // Comments in Xcode + case HighlightError.rawValue: + return NSColor(hex: "#C41A16") // Strings in Xcode + default: + return NSColor(hex: "#000000") // Plain text in Xcode + } + } +} + +struct ConfTextDarkAquaColorTheme: ConfTextColorTheme { + func color(for highlightType: highlight_type) -> NSColor { + switch highlightType.rawValue { + case HighlightSection.rawValue: + return NSColor(hex: "#91D462") // Class name in Xcode + case HighlightField.rawValue: + return NSColor(hex: "#FC5FA3") // Keywords in Xcode + case HighlightPublicKey.rawValue, HighlightPrivateKey.rawValue, HighlightPresharedKey.rawValue: + return NSColor(hex: "#FD8F3F") // Preprocessor directives in Xcode + case HighlightIP.rawValue, HighlightHost.rawValue: + return NSColor(hex: "#53A5FB") // URLs in Xcode + case HighlightCidr.rawValue, HighlightPort.rawValue: + return NSColor(hex: "#75B492") // Attributes in Xcode + case HighlightMTU.rawValue, HighlightKeepalive.rawValue: + return NSColor(hex: "#9686F5") // Numbers in Xcode + case HighlightComment.rawValue: + return NSColor(hex: "#6C7986") // Comments in Xcode + case HighlightError.rawValue: + return NSColor(hex: "#FF4C4C") // Strings in Xcode + default: + return NSColor(hex: "#FFFFFF") // Plain text in Xcode + } + } +} |