Initialize UIColor from RGB hex in Swift

Want to initialize a UIColor object from a hex code?

Create a new Swift class named “UIColor+FromRGB.swift” with the following content:

Initializing a UIColor object then is now a matter of a one-liner, e.g.: