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 // MARK: - Configuration
//-------------------------------------------------- //--------------------------------------------------
private var iconColorConfiguration: AnyColorable { private var iconColorConfiguration: AnyColorable {
if selectedIconName != nil, selectable { if kind == .highContrast {
return selectedIconColorConfiguration return highContrastIconColorConfiguration
} else if kind == .lowContrast {
return (surfaceType == .colorFill) ? lowContrastIconColorConfiguration : (floating ? lowContrastIconColorConfiguration : standardIconColorConfiguration)
} else { } else {
if kind == .highContrast { return standardIconColorConfiguration
return highContrastIconColorConfiguration
} else {
return standardIconColorConfiguration
}
} }
} }
@ -192,16 +190,16 @@ open class ButtonIcon: Control {
}.eraseToAnyColorable() }.eraseToAnyColorable()
}() }()
private var highContrastIconColorConfiguration: AnyColorable = { private var lowContrastIconColorConfiguration: AnyColorable = {
return SurfaceColorConfiguration(VDSColor.elementsPrimaryOndark, VDSColor.elementsPrimaryOnlight).eraseToAnyColorable() 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 = { private var highContrastIconColorConfiguration: AnyColorable = {
return ControlColorConfiguration().with { return SurfaceColorConfiguration(VDSColor.elementsPrimaryOndark, VDSColor.elementsPrimaryOnlight).eraseToAnyColorable()
$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 struct GhostConfiguration: Configuration { private struct GhostConfiguration: Configuration {