updated color for state changes
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
e89e1bf4d0
commit
f41e6f9c9c
@ -67,13 +67,35 @@ open class Tooltip: Control, TooltipLaunchable {
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Configuration
|
// MARK: - Configuration
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
private var iconColorConfig: AnyColorable = {
|
private var iconColorConfig: AnyColorable {
|
||||||
let config = KeyedColorConfiguration<Tooltip, FillColor>(keyPath: \.fillColor)
|
switch fillColor {
|
||||||
config.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forKey: .primary)
|
|
||||||
config.setSurfaceColors(VDSColor.elementsSecondaryOnlight, VDSColor.elementsSecondaryOndark, forKey: .secondary)
|
case .primary:
|
||||||
config.setSurfaceColors(VDSColor.elementsBrandhighlight, VDSColor.elementsBrandhighlight, forKey: .brandHighlight)
|
return primaryColorConfig.eraseToAnyColorable()
|
||||||
return config.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
|
// MARK: - Initializers
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user