aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI/macOS/NSColor+Hex.swift
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2019-01-21 19:07:42 +0530
committerRoopesh Chander <roop@roopc.net>2019-01-21 19:07:42 +0530
commitf6c9ce2d716f2f096be333bf5f1f1689a55f17b9 (patch)
treef26b1fc1becb0cbbccc725fce9a02308e5a22607 /WireGuard/WireGuard/UI/macOS/NSColor+Hex.swift
parentmacOS: show icon for inactive state (diff)
downloadwireguard-apple-f6c9ce2d716f2f096be333bf5f1f1689a55f17b9.tar.xz
wireguard-apple-f6c9ce2d716f2f096be333bf5f1f1689a55f17b9.zip
macOS: Simplify NSColor extension
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to '')
-rw-r--r--WireGuard/WireGuard/UI/macOS/NSColor+Hex.swift2
1 files changed, 1 insertions, 1 deletions
diff --git a/WireGuard/WireGuard/UI/macOS/NSColor+Hex.swift b/WireGuard/WireGuard/UI/macOS/NSColor+Hex.swift
index 7f758396..4ca4f058 100644
--- a/WireGuard/WireGuard/UI/macOS/NSColor+Hex.swift
+++ b/WireGuard/WireGuard/UI/macOS/NSColor+Hex.swift
@@ -19,7 +19,7 @@ extension NSColor {
var rgb: UInt32 = 0
Scanner(string: hexString).scanHexInt32(&rgb)
- self.init(red: CGFloat((rgb & 0xFF0000) >> 16) / 255.0, green: CGFloat((rgb & 0x00FF00) >> 8) / 255.0, blue: CGFloat(rgb & 0x0000FF) / 255.0, alpha: 1)
+ self.init(red: CGFloat((rgb >> 16) & 0xff) / 255.0, green: CGFloat((rgb >> 8) & 0xff) / 255.0, blue: CGFloat((rgb >> 0) & 0xff) / 255.0, alpha: 1)
}
}