refactored hexstring to uicolor

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-05-06 18:40:48 -05:00
parent 6a07bcdd4c
commit aa3b11efc1
2 changed files with 9 additions and 8 deletions

View File

@ -81,7 +81,7 @@ open class TileContainerBase<PaddingType: DefaultValuing>: Control where Padding
/// Enum used to describe the background effect choices used for this component. /// Enum used to describe the background effect choices used for this component.
public enum BackgroundEffect { public enum BackgroundEffect {
case transparency case transparency
case gradient(String, String) case gradient(UIColor, UIColor)
case none case none
} }
@ -199,7 +199,7 @@ open class TileContainerBase<PaddingType: DefaultValuing>: Control where Padding
}.eraseToAnyColorable() }.eraseToAnyColorable()
$0.shadowOffsetConfiguration = .init(.init(width: 0, height: 6), .zero) $0.shadowOffsetConfiguration = .init(.init(width: 0, height: 6), .zero)
$0.shadowRadiusConfiguration = .init(8.0, 0.0) $0.shadowRadiusConfiguration = .init(8.0, 0.0)
$0.shadowOpacityConfiguration = .init(0.01, 0.0) $0.shadowOpacityConfiguration = .init(0.1, 0.0)
} }
private var borderColorConfiguration = SurfaceColorConfiguration().with { private var borderColorConfiguration = SurfaceColorConfiguration().with {
@ -391,7 +391,7 @@ open class TileContainerBase<PaddingType: DefaultValuing>: Control where Padding
removeGradientLayer() removeGradientLayer()
case .gradient(let firstColor, let secondColor): case .gradient(let firstColor, let secondColor):
alphaConfiguration = 1.0 alphaConfiguration = 1.0
addGradientLayer(with: UIColor(hexString: firstColor), secondColor: UIColor(hexString: secondColor)) addGradientLayer(with: firstColor, secondColor: secondColor)
backgroundImageView.isHidden = true backgroundImageView.isHidden = true
backgroundImageView.alpha = 1.0 backgroundImageView.alpha = 1.0
case .none: case .none:

View File

@ -7,6 +7,7 @@
import Foundation import Foundation
import VDSTokens import VDSTokens
import UIKit
extension TitleLockup { extension TitleLockup {
private static var textColorSecondaryConfiguration = SurfaceColorConfiguration(VDSColor.elementsSecondaryOnlight , VDSColor.elementsSecondaryOnlight).eraseToAnyColorable() private static var textColorSecondaryConfiguration = SurfaceColorConfiguration(VDSColor.elementsSecondaryOnlight , VDSColor.elementsSecondaryOnlight).eraseToAnyColorable()
@ -16,7 +17,7 @@ extension TitleLockup {
public enum TextColor: Equatable { public enum TextColor: Equatable {
case primary case primary
case secondary case secondary
case custom(String, String) case custom(UIColor, UIColor)
private var reflectedValue: String { String(reflecting: self) } private var reflectedValue: String { String(reflecting: self) }
@ -31,15 +32,15 @@ extension TitleLockup {
case .secondary: case .secondary:
TitleLockup.textColorSecondaryConfiguration TitleLockup.textColorSecondaryConfiguration
case .custom(let lightColor, let darkColor): case .custom(let lightColor, let darkColor):
SurfaceColorConfiguration(.init(hexString: lightColor), .init(hexString: darkColor)).eraseToAnyColorable() SurfaceColorConfiguration(lightColor, darkColor).eraseToAnyColorable()
} }
} }
} }
public enum TitleTextColor: Equatable { public enum TitleTextColor: Equatable {
case primary case primary
case custom(String, String) case custom(UIColor, UIColor)
private var reflectedValue: String { String(reflecting: self) } private var reflectedValue: String { String(reflecting: self) }
public static func == (lhs: Self, rhs: Self) -> Bool { public static func == (lhs: Self, rhs: Self) -> Bool {
@ -51,7 +52,7 @@ extension TitleLockup {
case .primary: case .primary:
TitleLockup.textColorPrimaryConfiguration TitleLockup.textColorPrimaryConfiguration
case .custom(let lightColor, let darkColor): case .custom(let lightColor, let darkColor):
SurfaceColorConfiguration(.init(hexString: lightColor), .init(hexString: darkColor)).eraseToAnyColorable() SurfaceColorConfiguration(lightColor, darkColor).eraseToAnyColorable()
} }
} }
} }