jazzedge
12/24/2017 - 5:02 PM

Swift - RGB color conversion utility

import UIKit

extension UIColor {

    static func rgbColor(r: CGFloat, g: CGFloat, b: CGFloat, a: CGFloat = 1.0) -> UIColor {
        return UIColor(red: r/255.0, green: g/255.0, blue: b/255.0, alpha: a)
    }

}