[Swift]getUIColorByColorTuple

typealias rgbTuple = (r:CGFloat,g:CGFloat,b:CGFloat)

func getUIColorByColorTuple(color:rgbTuple, alpha:CGFloat=1.0, luminanceScale:CGFloat = 1.0) -> UIColor{
    var colort:rgbTuple = (r:color.r,g:color.g,b:color.b)
    let rl:CGFloat = 0.298912 * colort.r
    colort.r = rl * luminanceScale / 0.298912
    let gl:CGFloat = 0.586611 * colort.g
    colort.g = gl * luminanceScale / 0.586611
    let bl:CGFloat = 0.114478 * colort.b
    colort.b = bl * luminanceScale / 0.114478
    
    return UIColor(red: colort.r, green: colort.g, blue: colort.b, alpha: alpha)
}