1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-01 01:32:04 +03:00
vimr/SwiftNeoVim/ColorUtils.swift
2016-06-18 23:09:34 +02:00

18 lines
413 B
Swift

/**
* Tae Won Ha - http://taewon.de - @hataewon
* See LICENSE
*/
import Cocoa
class ColorUtils {
static func colorFromCodeIgnoringAlpha(rgb: UInt32) -> NSColor {
let red = (CGFloat((rgb >> 16) & 0xFF)) / 255.0;
let green = (CGFloat((rgb >> 8) & 0xFF)) / 255.0;
let blue = (CGFloat((rgb ) & 0xFF)) / 255.0;
return NSColor(SRGBRed: red, green: green, blue: blue, alpha: 1.0)
}
}