mirror of
https://github.com/twofas/2fas-ios.git
synced 2024-11-25 19:59:58 +01:00
TF-1316 New tint colors
This commit is contained in:
parent
f09c9c1c49
commit
86f1091481
@ -21,14 +21,16 @@ import Foundation
|
||||
|
||||
public enum TintColor: String, Hashable, CaseIterable {
|
||||
case `default`
|
||||
case lightBlue
|
||||
case indigo
|
||||
case purple
|
||||
case turquoise
|
||||
case green
|
||||
case red
|
||||
case orange
|
||||
case yellow
|
||||
case green
|
||||
case turquoise
|
||||
case lightBlue
|
||||
case indigo
|
||||
case pink
|
||||
case purple
|
||||
case brown
|
||||
}
|
||||
|
||||
public extension TintColor {
|
||||
@ -74,6 +76,8 @@ public extension TintColor {
|
||||
case "Red": return .red
|
||||
case "Orange": return .orange
|
||||
case "Yellow": return .yellow
|
||||
case "Pink": return .pink
|
||||
case "Brown": return .brown
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
@ -95,6 +99,8 @@ public extension TintColor {
|
||||
case .red: return "Red"
|
||||
case .orange: return "Orange"
|
||||
case .yellow: return "Yellow"
|
||||
case .pink: return "Pink"
|
||||
case .brown: return "Brown"
|
||||
}
|
||||
}
|
||||
|
||||
@ -110,6 +116,8 @@ public extension TintColor {
|
||||
case .red: return UIColor(named: "redColor", in: bundle, compatibleWith: nil)!
|
||||
case .orange: return UIColor(named: "orangeColor", in: bundle, compatibleWith: nil)!
|
||||
case .yellow: return UIColor(named: "yellowColor", in: bundle, compatibleWith: nil)!
|
||||
case .pink: return UIColor(named: "pinkColor", in: bundle, compatibleWith: nil)!
|
||||
case .brown: return UIColor(named: "brownColor", in: bundle, compatibleWith: nil)!
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,20 @@
|
||||
{
|
||||
"colors" : [
|
||||
{
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "0x57",
|
||||
"green" : "0x88",
|
||||
"red" : "0xBD"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
{
|
||||
"colors" : [
|
||||
{
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "0xDE",
|
||||
"green" : "0x49",
|
||||
"red" : "0xCA"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
@ -5,9 +5,9 @@
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "0xF2",
|
||||
"green" : "0x5E",
|
||||
"red" : "0xB1"
|
||||
"blue" : "0xDE",
|
||||
"green" : "0x49",
|
||||
"red" : "0x8C"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
|
@ -32,6 +32,8 @@ extension TintColor {
|
||||
case .red: return T.Color.red
|
||||
case .orange: return T.Color.orange
|
||||
case .yellow: return T.Color.yellow
|
||||
case .pink: return T.Color.pink
|
||||
case .brown: return T.Color.brown
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -85,10 +85,10 @@ extension AddingServiceManuallyModuleInteractor: AddingServiceManuallyModuleInte
|
||||
otpAuth: nil,
|
||||
tokenPeriod: tokenPeriod ?? .defaultValue,
|
||||
tokenLength: tokenLength ?? .defaultValue,
|
||||
badgeColor: nil,
|
||||
badgeColor: .default,
|
||||
iconType: .brand,
|
||||
iconTypeID: iconTypeID ?? .default,
|
||||
labelColor: .default,
|
||||
labelColor: .lightBlue,
|
||||
labelTitle: name.twoLetters,
|
||||
algorithm: algorithm ?? .defaultValue,
|
||||
counter: counter,
|
||||
|
@ -74,11 +74,23 @@ final class ColorGridSelector: UIView {
|
||||
buttons.insert(UIView(), at: 2)
|
||||
}
|
||||
|
||||
buttons.forEach { v in
|
||||
v.translatesAutoresizingMaskIntoConstraints = false
|
||||
}
|
||||
|
||||
let sv = UIStackView(arrangedSubviews: buttons)
|
||||
sv.axis = .horizontal
|
||||
sv.alignment = .center
|
||||
sv.distribution = .equalSpacing
|
||||
sv.spacing = Theme.Metrics.doubleMargin * 2
|
||||
|
||||
NSLayoutConstraint.activate([
|
||||
buttons[0].widthAnchor.constraint(equalTo: buttons[1].widthAnchor),
|
||||
buttons[1].widthAnchor.constraint(equalTo: buttons[2].widthAnchor),
|
||||
buttons[0].heightAnchor.constraint(equalTo: buttons[1].heightAnchor),
|
||||
buttons[1].heightAnchor.constraint(equalTo: buttons[2].heightAnchor)
|
||||
])
|
||||
|
||||
return sv
|
||||
}
|
||||
mainStack.addArrangedSubviews(colorsChunked)
|
||||
|
Loading…
Reference in New Issue
Block a user