From aa3b11efc15242a8a11f340cce3e35ed2d74eb28 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Mon, 6 May 2024 18:40:48 -0500 Subject: [PATCH] refactored hexstring to uicolor Signed-off-by: Matt Bruce --- VDS/Components/TileContainer/TileContainer.swift | 6 +++--- VDS/Components/TitleLockup/TitleLockupTextColor.swift | 11 ++++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/VDS/Components/TileContainer/TileContainer.swift b/VDS/Components/TileContainer/TileContainer.swift index eb356ecc..61d7a941 100644 --- a/VDS/Components/TileContainer/TileContainer.swift +++ b/VDS/Components/TileContainer/TileContainer.swift @@ -81,7 +81,7 @@ open class TileContainerBase: Control where Padding /// Enum used to describe the background effect choices used for this component. public enum BackgroundEffect { case transparency - case gradient(String, String) + case gradient(UIColor, UIColor) case none } @@ -199,7 +199,7 @@ open class TileContainerBase: Control where Padding }.eraseToAnyColorable() $0.shadowOffsetConfiguration = .init(.init(width: 0, height: 6), .zero) $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 { @@ -391,7 +391,7 @@ open class TileContainerBase: Control where Padding removeGradientLayer() case .gradient(let firstColor, let secondColor): alphaConfiguration = 1.0 - addGradientLayer(with: UIColor(hexString: firstColor), secondColor: UIColor(hexString: secondColor)) + addGradientLayer(with: firstColor, secondColor: secondColor) backgroundImageView.isHidden = true backgroundImageView.alpha = 1.0 case .none: diff --git a/VDS/Components/TitleLockup/TitleLockupTextColor.swift b/VDS/Components/TitleLockup/TitleLockupTextColor.swift index 2febd80b..c0760b6f 100644 --- a/VDS/Components/TitleLockup/TitleLockupTextColor.swift +++ b/VDS/Components/TitleLockup/TitleLockupTextColor.swift @@ -7,6 +7,7 @@ import Foundation import VDSTokens +import UIKit extension TitleLockup { private static var textColorSecondaryConfiguration = SurfaceColorConfiguration(VDSColor.elementsSecondaryOnlight , VDSColor.elementsSecondaryOnlight).eraseToAnyColorable() @@ -16,7 +17,7 @@ extension TitleLockup { public enum TextColor: Equatable { case primary case secondary - case custom(String, String) + case custom(UIColor, UIColor) private var reflectedValue: String { String(reflecting: self) } @@ -31,15 +32,15 @@ extension TitleLockup { case .secondary: TitleLockup.textColorSecondaryConfiguration case .custom(let lightColor, let darkColor): - SurfaceColorConfiguration(.init(hexString: lightColor), .init(hexString: darkColor)).eraseToAnyColorable() + SurfaceColorConfiguration(lightColor, darkColor).eraseToAnyColorable() } } } public enum TitleTextColor: Equatable { case primary - case custom(String, String) - + case custom(UIColor, UIColor) + private var reflectedValue: String { String(reflecting: self) } public static func == (lhs: Self, rhs: Self) -> Bool { @@ -51,7 +52,7 @@ extension TitleLockup { case .primary: TitleLockup.textColorPrimaryConfiguration case .custom(let lightColor, let darkColor): - SurfaceColorConfiguration(.init(hexString: lightColor), .init(hexString: darkColor)).eraseToAnyColorable() + SurfaceColorConfiguration(lightColor, darkColor).eraseToAnyColorable() } } }