Fixed a colour conversion issue.
This commit is contained in:
@@ -17,8 +17,8 @@ extension MTColor {
|
||||
let scanner = Scanner(string: hexString)
|
||||
scanner.charactersToBeSkipped = CharacterSet(charactersIn: "#")
|
||||
scanner.scanHexInt64(&rgbValue)
|
||||
return MTColor(red: CGFloat((rgbValue & 0xFF0000))/255.0,
|
||||
green: CGFloat((rgbValue & 0xFF00))/255.0,
|
||||
return MTColor(red: CGFloat((rgbValue & 0xFF0000) >> 16)/255.0,
|
||||
green: CGFloat((rgbValue & 0xFF00) >> 8)/255.0,
|
||||
blue: CGFloat((rgbValue & 0xFF))/255.0, alpha: 1.0)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user