1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-11-24 11:37:32 +03:00
vimr/SwiftNeoVim/ColorUtils.swift

18 lines
407 B
Swift
Raw Normal View History

/**
* Tae Won Ha - http://taewon.de - @hataewon
* See LICENSE
*/
import Cocoa
class ColorUtils {
2016-06-16 19:36:26 +03:00
static func colorFromCode(rgb: UInt32) -> NSColor {
let red = (CGFloat((rgb >> 16) & 0x000000FF)) / 255.0;
let green = (CGFloat((rgb >> 8 ) & 0x000000FF)) / 255.0;
let blue = (CGFloat(rgb & 0x000000FF)) / 255.0;
return NSColor(SRGBRed: red, green: green, blue: blue, alpha: 1.0)
}
}