diff --git a/Signal/src/ViewControllers/HomeView/Chat List/ChatListViewController+BackupDownloadProgressView.swift b/Signal/src/ViewControllers/HomeView/Chat List/ChatListViewController+BackupDownloadProgressView.swift index b7a04d373e..e165240d6c 100644 --- a/Signal/src/ViewControllers/HomeView/Chat List/ChatListViewController+BackupDownloadProgressView.swift +++ b/Signal/src/ViewControllers/HomeView/Chat List/ChatListViewController+BackupDownloadProgressView.swift @@ -214,7 +214,7 @@ public class CLVBackupDownloadProgressView: BackupDownloadProgressView.Delegate icon: .backupErrorDisplayBold, iconSize: 40, tintColor: UIColor.Signal.orange, - backgroundColor: UIColor.color(rgbHex: 0xF9E4B6), + backgroundColor: UIColor(rgbHex: 0xF9E4B6), ), title: String( format: OWSLocalizedString( diff --git a/SignalServiceKit/Util/UIColor+SSK.swift b/SignalServiceKit/Util/UIColor+SSK.swift index a50206685f..2cd943d3f0 100644 --- a/SignalServiceKit/Util/UIColor+SSK.swift +++ b/SignalServiceKit/Util/UIColor+SSK.swift @@ -5,28 +5,15 @@ public import UIKit -@objc -public extension UIColor { - @objc(colorWithRGBHex:) - class func color(rgbHex: UInt32) -> UIColor { - return UIColor(rgbHex: rgbHex) - } - - convenience init(rgbHex value: UInt32) { +extension UIColor { + public convenience init(rgbHex value: UInt32, alpha: CGFloat = 1) { let red = CGFloat((value >> 16) & 0xff) / 255.0 let green = CGFloat((value >> 8) & 0xff) / 255.0 let blue = CGFloat((value >> 0) & 0xff) / 255.0 self.init(red: red, green: green, blue: blue, alpha: 1) } - convenience init(rgbHex value: UInt32, alpha: CGFloat) { - let red = CGFloat((value >> 16) & 0xff) / 255.0 - let green = CGFloat((value >> 8) & 0xff) / 255.0 - let blue = CGFloat((value >> 0) & 0xff) / 255.0 - self.init(red: red, green: green, blue: blue, alpha: alpha) - } - - var rgbHex: UInt32 { + public var rgbHex: UInt32 { var red = CGFloat.zero var green = CGFloat.zero var blue = CGFloat.zero @@ -34,7 +21,7 @@ public extension UIColor { return UInt32(red * 255) << 16 | UInt32(green * 255) << 8 | UInt32(blue * 255) << 0 } - convenience init(argbHex value: UInt32) { + public convenience init(argbHex value: UInt32) { let alpha = CGFloat((value >> 24) & 0xff) / 255.0 let red = CGFloat((value >> 16) & 0xff) / 255.0 let green = CGFloat((value >> 8) & 0xff) / 255.0 @@ -42,7 +29,7 @@ public extension UIColor { self.init(red: red, green: green, blue: blue, alpha: alpha) } - var argbHex: UInt32 { + public var argbHex: UInt32 { var alpha = CGFloat.zero var red = CGFloat.zero var green = CGFloat.zero @@ -51,7 +38,7 @@ public extension UIColor { return UInt32(alpha * 255) << 24 | UInt32(red * 255) << 16 | UInt32(green * 255) << 8 | UInt32(blue * 255) << 0 } - func isEqualToColor(_ color: UIColor, tolerance: CGFloat = 0) -> Bool { + public func isEqualToColor(_ color: UIColor, tolerance: CGFloat = 0) -> Bool { var r1: CGFloat = 0 var g1: CGFloat = 0 var b1: CGFloat = 0 diff --git a/SignalUI/ImageEditor/RotationControl.swift b/SignalUI/ImageEditor/RotationControl.swift index b6641c3c17..5a25c82d12 100644 --- a/SignalUI/ImageEditor/RotationControl.swift +++ b/SignalUI/ImageEditor/RotationControl.swift @@ -92,7 +92,7 @@ class RotationControl: UIControl { initializeRuler() // Current Value Marking - currentValueMark.backgroundColor = UIColor.color(rgbHex: 0x62E87A) + currentValueMark.backgroundColor = UIColor(rgbHex: 0x62E87A) addSubview(currentValueMark) currentValueMark.autoSetDimension(.width, toSize: Constants.markingWidth) currentValueMark.autoPinEdge(.top, to: .top, of: scrollView)