반응형
https://www.raywenderlich.com/1039-scanner-tutorial-for-macos
cell.backgroundColor = UIColor(hexColor: "9d9d9d")
extension UIColor {
convenience init(hexColor: String) {
let scannHex = Scanner(string: hexColor)
var rgbValue: UInt64 = 0
scannHex.scanLocation = 0
scannHex.scanHexInt64(&rgbValue)
let r = (rgbValue & 0xff0000) >> 16
let g = (rgbValue & 0xff00) >> 8
let b = rgbValue & 0xff
self.init(
red: CGFloat(r) / 0xff,
green: CGFloat(g) / 0xff,
blue: CGFloat(b) / 0xff, alpha: 1
)
}
}
반응형
'3D world > Unreal Engine Games Review' 카테고리의 다른 글
테마적용? (0) | 2019.01.12 |
---|---|
changing detail view in MDview (0) | 2019.01.12 |
master cell customizing : master detail view (0) | 2019.01.12 |
싱글톤은 최소 2개 이상 (0) | 2019.01.12 |
한번에 여러개의 UIControl 속성을 지정하고 싶을 때 (0) | 2019.01.12 |
최근댓글