You can easily create a UIColor from a hex color string in Swift using an extension on UIColor. Here's the code for the extension:
main.swift891 chars28 linesTo use this extension, simply create a new UIColor instance using the hexString parameter:
main.swift44 chars2 linesThis will create a new UIColor instance with the red color #FF0000 (equivalent to UIColor.red).
gistlibby LogSnag