updated colorconfiguration to look at isEnabled
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
d10b575511
commit
1b9a2799b2
@ -143,7 +143,7 @@ public class ControlColorConfiguration: KeyColorConfigurable {
|
|||||||
///Meant to be used with any object that implements Surfaceable and Disabling. More than likely this is any View.
|
///Meant to be used with any object that implements Surfaceable and Disabling. More than likely this is any View.
|
||||||
public class ViewColorConfiguration: KeyColorConfigurable {
|
public class ViewColorConfiguration: KeyColorConfigurable {
|
||||||
public typealias KeyType = Bool
|
public typealias KeyType = Bool
|
||||||
public typealias ObjectType = Surfaceable & Disabling
|
public typealias ObjectType = Surfaceable & Enabling
|
||||||
public var keyColors: [KeyColorConfiguration<KeyType>] = []
|
public var keyColors: [KeyColorConfiguration<KeyType>] = []
|
||||||
|
|
||||||
public required init() { }
|
public required init() { }
|
||||||
@ -161,7 +161,7 @@ public class ViewColorConfiguration: KeyColorConfigurable {
|
|||||||
/// - Parameter object: Object that implements Surfaceable and Disabling
|
/// - Parameter object: Object that implements Surfaceable and Disabling
|
||||||
/// - Returns: UIColor correspoding to either true/false for the disabled state and surface
|
/// - Returns: UIColor correspoding to either true/false for the disabled state and surface
|
||||||
public func getColor(_ object: ObjectType) -> UIColor {
|
public func getColor(_ object: ObjectType) -> UIColor {
|
||||||
if let keyColor = keyColors.first(where: {$0.key == object.disabled }) {
|
if let keyColor = keyColors.first(where: {$0.key == !object.isEnabled }) {
|
||||||
return keyColor.surfaceConfig.getColor(object)
|
return keyColor.surfaceConfig.getColor(object)
|
||||||
} else {
|
} else {
|
||||||
return .clear //default
|
return .clear //default
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user