story:ONEAPP-6315: updated icon and background color configurations as per spec

This commit is contained in:
vasavk 2024-02-12 20:27:19 +05:30
parent cac411b03f
commit b3b3fa6965

View File

@ -156,14 +156,12 @@ open class ButtonIcon: Control {
// MARK: - Configuration
//--------------------------------------------------
private var iconColorConfiguration: AnyColorable {
if selectedIconName != nil, selectable {
return selectedIconColorConfiguration
if kind == .highContrast {
return highContrastIconColorConfiguration
} else if kind == .lowContrast {
return (surfaceType == .colorFill) ? lowContrastIconColorConfiguration : (floating ? lowContrastIconColorConfiguration : standardIconColorConfiguration)
} else {
if kind == .highContrast {
return highContrastIconColorConfiguration
} else {
return standardIconColorConfiguration
}
return standardIconColorConfiguration
}
}
@ -192,16 +190,16 @@ open class ButtonIcon: Control {
}.eraseToAnyColorable()
}()
private var highContrastIconColorConfiguration: AnyColorable = {
return SurfaceColorConfiguration(VDSColor.elementsPrimaryOndark, VDSColor.elementsPrimaryOnlight).eraseToAnyColorable()
private var lowContrastIconColorConfiguration: AnyColorable = {
return ControlColorConfiguration().with {
$0.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forState: .normal)
$0.setSurfaceColors(VDSColor.interactiveActiveOnlight, VDSColor.interactiveActiveOndark, forState: .highlighted)
$0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.paletteBlack.withAlphaComponent(0.70), forState: .disabled)
}.eraseToAnyColorable()
}()
private var selectedIconColorConfiguration: AnyColorable = {
return ControlColorConfiguration().with {
$0.setSurfaceColors(VDSColor.elementsBrandhighlight, VDSColor.elementsPrimaryOndark, forState: .normal)
$0.setSurfaceColors(VDSColor.interactiveActiveOnlight, VDSColor.interactiveActiveOndark, forState: .highlighted)
$0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forState: .disabled)
}.eraseToAnyColorable()
private var highContrastIconColorConfiguration: AnyColorable = {
return SurfaceColorConfiguration(VDSColor.elementsPrimaryOndark, VDSColor.elementsPrimaryOnlight).eraseToAnyColorable()
}()
private struct GhostConfiguration: Configuration {