Skip to content

Commit bf1b3a7

Browse files
authored
Changing Color implementation to use 64-bit unsigned ints (#305)
1 parent 5652d55 commit bf1b3a7

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

IFTTT SDK/Color.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ extension UIColor {
7979
return
8080
}
8181

82-
var value: UInt32 = 0
83-
Scanner(string: trimmed).scanHexInt32(&value)
82+
var value: UInt64 = 0
83+
Scanner(string: trimmed).scanHexInt64(&value)
8484
self.init(hex: value)
8585
}
8686

87-
convenience init(hex: UInt32) {
87+
convenience init(hex: UInt64) {
8888
let r = (hex & 0xff0000) >> 16
8989
let g = (hex & 0xff00) >> 8
9090
let b = hex & 0xff
@@ -96,15 +96,15 @@ extension UIColor {
9696
)
9797
}
9898

99-
var hex: UInt32 {
99+
var hex: UInt64 {
100100
var r: CGFloat = 0
101101
var g: CGFloat = 0
102102
var b: CGFloat = 0
103103
self.getRed(&r, green: &g, blue: &b, alpha: nil)
104104

105-
var value = UInt32(r * 0xff) << 16
106-
value = value | (UInt32(g * 0xff) << 8)
107-
value = value | UInt32(b * 0xff)
105+
var value = UInt64(r * 0xff) << 16
106+
value = value | (UInt64(g * 0xff) << 8)
107+
value = value | UInt64(b * 0xff)
108108
return value
109109
}
110110
}

0 commit comments

Comments
 (0)