mirror of
https://github.com/passepartoutvpn/wireguard-apple.git
synced 2025-01-31 04:52:03 +00:00
macOS: Simplify NSColor extension
Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
parent
5aa0f1a25f
commit
f6c9ce2d71
@ -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)
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user