main.swift606 chars14 linesThis function takes a hex string and returns a UIColor object. The hex code may be in the format of either "RRGGBB" or "#RRGGBB". If the hex code does not contain an alpha value, one is assumed to be FF (fully opaque). If the conversion fails, nil is returned.
gistlibby LogSnag