mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-08 22:33:26 +01:00
Fixes Scanner.scanHexInt32 deprecation warning
This commit is contained in:
@@ -25,8 +25,8 @@ public extension UIColor
|
|||||||
convenience init?(hexString: String)
|
convenience init?(hexString: String)
|
||||||
{
|
{
|
||||||
let hex = hexString.trimmingCharacters(in: CharacterSet.alphanumerics.inverted)
|
let hex = hexString.trimmingCharacters(in: CharacterSet.alphanumerics.inverted)
|
||||||
var int = UInt32()
|
guard let int32 = Scanner(string: hex).scanInt32(representation: .hexadecimal), case let int = UInt32(int32) else { return nil }
|
||||||
Scanner(string: hex).scanHexInt32(&int)
|
|
||||||
let a, r, g, b: UInt32
|
let a, r, g, b: UInt32
|
||||||
switch hex.count {
|
switch hex.count {
|
||||||
case 3: // RGB (12-bit)
|
case 3: // RGB (12-bit)
|
||||||
|
|||||||
Reference in New Issue
Block a user