Group accessory color with less alpha

This commit is contained in:
Davide De Rosa 2018-10-15 00:12:37 +02:00
parent 5c0738b136
commit ac06d2ccde
2 changed files with 6 additions and 2 deletions

View File

@ -28,7 +28,7 @@ import UIKit
extension UITableViewCell { extension UITableViewCell {
func applyChecked(_ checked: Bool, _ theme: Theme) { func applyChecked(_ checked: Bool, _ theme: Theme) {
accessoryType = checked ? .checkmark : .none accessoryType = checked ? .checkmark : .none
tintColor = Theme.current.palette.colorAction.withAlphaComponent(0.7) tintColor = Theme.current.palette.colorAccessory
} }
} }

View File

@ -64,6 +64,10 @@ struct Theme {
return colorAccent1 return colorAccent1
} }
var colorAccessory: UIColor {
return colorAccent1.withAlphaComponent(0.7)
}
var colorDestructive = UIColor(red: 0.8, green: 0.27, blue: 0.2, alpha: 1.0) var colorDestructive = UIColor(red: 0.8, green: 0.27, blue: 0.2, alpha: 1.0)
} }
@ -95,7 +99,7 @@ extension Theme {
toolbar.tintColor = palette.colorPrimaryLightText toolbar.tintColor = palette.colorPrimaryLightText
let toggle = UISwitch.appearance() let toggle = UISwitch.appearance()
toggle.onTintColor = palette.colorAction.withAlphaComponent(0.7) toggle.onTintColor = palette.colorAccessory
} }
} }