added selected Icon Color Configuration

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-04-18 14:18:40 -05:00
parent a8e1f96d9b
commit 7eddaf1d04

View File

@ -138,6 +138,8 @@ open class ButtonIcon: Control, Changeable, FormFieldable {
/// Icon Name used within the Icon within the Selected State.
open var selectedIconName: Icon.Name? { didSet { setNeedsUpdate() } }
open var selectedIconColorConfiguration: SurfaceColorConfiguration? { didSet { setNeedsUpdate() } }
/// Sets the size of button icon and icon.
open var size: Size = .large { didSet { setNeedsUpdate() } }
@ -180,6 +182,9 @@ open class ButtonIcon: Control, Changeable, FormFieldable {
// MARK: - Configuration
//--------------------------------------------------
private var iconColorConfiguration: AnyColorable {
if let selectedIconColorConfiguration, isSelected {
return selectedIconColorConfiguration.eraseToAnyColorable()
} else {
if kind == .highContrast {
return highContrastIconColorConfiguration
} else if kind == .lowContrast {
@ -188,6 +193,7 @@ open class ButtonIcon: Control, Changeable, FormFieldable {
return standardIconColorConfiguration
}
}
}
private var currentConfiguration: any Configuration {
switch kind {