ランダムなUIColorが取得したかったので簡単なエクステンションを書いてみました
rgbそれぞれをランダムに作成しUIColorを作成、それを返すだけ
import UIKit
extension UIColor {
    static var rand : UIColor {
        let r = CGFloat.random(in: 0 ... 255) / 255.0
        let g = CGFloat.random(in: 0 ... 255) / 255.0
        let b = CGFloat.random(in: 0 ... 255) / 255.0
        return UIColor(red: r, green: g, blue: b, alpha: 1.0)
    }
}使い方は簡単
バックラウンドの色をランダムにする場合は下記のようになります
self.view.backgroundColor = UIColor.rand