Adapt UI with respect to Dark Mode
This commit is contained in:
parent
35bac7260b
commit
414e31cba3
7 changed files with 24 additions and 25 deletions
|
|
@ -41,11 +41,14 @@ public class Globals {
|
|||
public static let passwordFont = UIFont(name: "Courier-Bold", size: UIFont.labelFontSize - 1)
|
||||
|
||||
// UI related
|
||||
public static let red = UIColor(red:1.00, green:0.23, blue:0.19, alpha:1.0)
|
||||
public static let blue = UIColor(red:0.00, green:0.48, blue:1.00, alpha:1.0)
|
||||
public static let letterColor = UIColor(red:40/255.0, green:42/255.0, blue:54/255.0, alpha:1.0)
|
||||
public static let symbolColor = UIColor(red:200/255.0, green:40/255.0, blue:41/255.0, alpha:1.0)
|
||||
public static let digitColor = UIColor(red:66/255.0, green:113/255.0, blue:174/255.0, alpha:1.0)
|
||||
public static let red = UIColor.systemRed
|
||||
public static let blue = UIColor.systemBlue
|
||||
public static let black: UIColor = {
|
||||
if #available(iOSApplicationExtension 13.0, *) {
|
||||
return UIColor.label
|
||||
}
|
||||
return UIColor.black
|
||||
}()
|
||||
public static let tableCellButtonSize = CGFloat(20.0)
|
||||
|
||||
private init() { }
|
||||
|
|
|
|||
|
|
@ -22,11 +22,11 @@ public class Utils {
|
|||
for (index, element) in plainPassword.unicodeScalars.enumerated() {
|
||||
var charColor = UIColor.darkText
|
||||
if NSCharacterSet.decimalDigits.contains(element) {
|
||||
charColor = Globals.digitColor
|
||||
charColor = Globals.red
|
||||
} else if !NSCharacterSet.letters.contains(element) {
|
||||
charColor = Globals.symbolColor
|
||||
charColor = Globals.blue
|
||||
} else {
|
||||
charColor = Globals.letterColor
|
||||
charColor = Globals.black
|
||||
}
|
||||
attributedPassword.addAttribute(NSAttributedString.Key.foregroundColor, value: charColor, range: NSRange(location: index, length: 1))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue