|
@@ -118,4 +118,18 @@ public extension UIColor {
|
|
|
let color = UIColor(red: red / 255.0, green: green / 255.0, blue: blue / 255.0, alpha: 1.0)
|
|
|
return color
|
|
|
}
|
|
|
+
|
|
|
+ func getColor(lightColor:UIColor = .white, darkColor:UIColor = .darkGray) -> UIColor{
|
|
|
+ if #available(iOS 13.0, *) {
|
|
|
+ return UIColor(dynamicProvider: { traitCollection in
|
|
|
+ if (traitCollection.userInterfaceStyle == .dark) {
|
|
|
+ return darkColor;
|
|
|
+ }else {
|
|
|
+ return lightColor;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ return lightColor;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|