Merge branch 'feature/tooltip' into 'develop'

updated color for state changes

See merge request BPHV_MIPS/vds_ios!57
This commit is contained in:
Bruce, Matt R 2023-04-17 21:37:38 +00:00
commit d81de0d382

View File

@ -67,13 +67,35 @@ open class Tooltip: Control, TooltipLaunchable {
//--------------------------------------------------
// MARK: - Configuration
//--------------------------------------------------
private var iconColorConfig: AnyColorable = {
let config = KeyedColorConfiguration<Tooltip, FillColor>(keyPath: \.fillColor)
config.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forKey: .primary)
config.setSurfaceColors(VDSColor.elementsSecondaryOnlight, VDSColor.elementsSecondaryOndark, forKey: .secondary)
config.setSurfaceColors(VDSColor.elementsBrandhighlight, VDSColor.elementsBrandhighlight, forKey: .brandHighlight)
return config.eraseToAnyColorable()
}()
private var iconColorConfig: AnyColorable {
switch fillColor {
case .primary:
return primaryColorConfig.eraseToAnyColorable()
case .secondary:
return secondaryColorConfig.eraseToAnyColorable()
case .brandHighlight:
return brandHighlightColorConfig.eraseToAnyColorable()
}
}
private var primaryColorConfig = ControlColorConfiguration().with {
$0.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forState: .normal)
$0.setSurfaceColors(VDSColor.interactiveActiveOnlight, VDSColor.interactiveActiveOndark, forState: .highlighted)
$0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forState: .disabled)
}
private var secondaryColorConfig = ControlColorConfiguration().with {
$0.setSurfaceColors(VDSColor.elementsSecondaryOnlight, VDSColor.elementsSecondaryOndark, forState: .normal)
$0.setSurfaceColors(VDSColor.paletteGray65, VDSColor.paletteGray65, forState: .highlighted)
$0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forState: .disabled)
}
private var brandHighlightColorConfig = ControlColorConfiguration().with {
$0.setSurfaceColors(VDSColor.elementsBrandhighlight, VDSColor.elementsBrandhighlight, forState: .normal)
$0.setSurfaceColors(VDSColor.elementsBrandhighlight, VDSColor.elementsBrandhighlight, forState: .highlighted)
$0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forState: .disabled)
}
//--------------------------------------------------
// MARK: - Initializers