Skip to content

Commit 28c436d

Browse files
committed
removed color extension
1 parent 463a3ea commit 28c436d

File tree

2 files changed

+8
-22
lines changed

2 files changed

+8
-22
lines changed

Source/Extension.swift

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -169,17 +169,3 @@ func toastStyle_pale(message: String, toastType: ToastType, toastGravity: ToastG
169169
toastView.msgLabel.text = message
170170
return toastView
171171
}
172-
173-
extension UIColor {
174-
convenience init(hex: String, alpha: CGFloat = 1.0) {
175-
var hexFormatted: String = hex.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines).uppercased()
176-
if hexFormatted.hasPrefix("#") {
177-
hexFormatted = String(hexFormatted.dropFirst())
178-
}
179-
assert(hexFormatted.count == 6, "Invalid hex code used.")
180-
var rgbValue: UInt64 = 0
181-
Scanner(string: hexFormatted).scanHexInt64(&rgbValue)
182-
self.init(red: CGFloat((rgbValue & 0xFF0000) >> 16) / 255.0, green: CGFloat((rgbValue & 0x00FF00) >> 8) / 255.0,
183-
blue: CGFloat(rgbValue & 0x0000FF) / 255.0, alpha: alpha)
184-
}
185-
}

Source/MotionToastStyles/MTPale.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,29 +53,29 @@ class MTPale: UIView {
5353
case .success:
5454
headLabel.text = "Success"
5555
circleImg.image = loadImage(name: "success_icon_white")
56-
sideBarView.backgroundColor = UIColor(hex: "6FCF97")
57-
circleView.backgroundColor = UIColor(hex: "6FCF97")
56+
sideBarView.backgroundColor = UIColor(red: 242.0, green: 201.0, blue: 76.0, alpha: 1.0)
57+
circleView.backgroundColor = UIColor(red: 242.0, green: 201.0, blue: 76.0, alpha: 1.0)
5858
toastView.backgroundColor = loadColor(name: "alpha_green_dark")
5959
break
6060
case .error:
6161
headLabel.text = "Error"
6262
circleImg.image = loadImage(name: "error_icon_white")
63-
sideBarView.backgroundColor = UIColor(hex: "EB5757")
64-
circleView.backgroundColor = UIColor(hex: "EB5757")
63+
sideBarView.backgroundColor = UIColor(red: 235.0, green: 87.0, blue: 87.0, alpha: 1.0)
64+
circleView.backgroundColor = UIColor(red: 235.0, green: 87.0, blue: 87.0, alpha: 1.0)
6565
toastView.backgroundColor = loadColor(name: "alpha_red_dark")
6666
break
6767
case .warning:
6868
headLabel.text = "Warning"
6969
circleImg.image = loadImage(name: "warning_icon_white")
70-
sideBarView.backgroundColor = UIColor(hex: "F2C94C")
71-
circleView.backgroundColor = UIColor(hex: "F2C94C")
70+
sideBarView.backgroundColor = UIColor(red: 242.0, green: 201.0, blue: 76.0, alpha: 1.0)
71+
circleView.backgroundColor = UIColor(red: 242.0, green: 201.0, blue: 76.0, alpha: 1.0)
7272
toastView.backgroundColor = loadColor(name: "alpha_yellow_dark")
7373
break
7474
case .info:
7575
headLabel.text = "Info"
7676
circleImg.image = loadImage(name: "info_icon_white")
77-
sideBarView.backgroundColor = UIColor(hex: "2F80ED")
78-
circleView.backgroundColor = UIColor(hex: "2F80ED")
77+
sideBarView.backgroundColor = UIColor(red: 47.0, green: 128.0, blue: 237.0, alpha: 1.0)
78+
circleView.backgroundColor = UIColor(red: 47.0, green: 128.0, blue: 237.0, alpha: 1.0)
7979
toastView.backgroundColor = loadColor(name: "alpha_blue_dark")
8080
break
8181
}

0 commit comments

Comments
 (0)