You can use this way for simple accessing (swift 4 & swift 5)
enum AssetsColor: String {
case backgroundGray
case blue
case colorAccent
case colorPrimary
case darkBlue
case yellow
}
extension UIColor {
static func appColor(_ name: AssetsColor) -> UIColor? {
return UIColor(named: name.rawValue)
}
}