yeahdongcn/UIColor-Hex-Swift

Prefix

Closed this issue · 1 comments

Why this:

        guard rgba.hasPrefix("#") else {
            throw UIColorInputError.missingHashMarkAsPrefix
        }
        
        let hexString: String = String(rgba[String.Index.init(encodedOffset: 1)...])
//...

Not:

        var hexString = rgba
        if hexString.hasPrefix("#") {
            hexString = String(hexString.dropFirst())
        }
//...

Thank you for fixing this.