diff --git a/VDS/Protocols/DropShadowable.swift b/VDS/Protocols/DropShadowable.swift index 120abb98..6587a3f2 100644 --- a/VDS/Protocols/DropShadowable.swift +++ b/VDS/Protocols/DropShadowable.swift @@ -11,7 +11,7 @@ import UIKit /** DropShadowable protocol helps with the configuration values for adding drop shadows for light & dark surfaces. */ -protocol DropShadowable { +public protocol DropShadowable { ///Shadow Color configuration for light and dark surfaces var shadowColorConfiguration: AnyColorable { get set } ///Shadow Opacity configuration for light and dark surfaces @@ -25,7 +25,7 @@ protocol DropShadowable { /** DropShadowableConfiguration protocol helps with multiple drop shadows configurations can be added to a view. */ -protocol DropShadowableConfiguration { +public protocol DropShadowableConfiguration { ///Configurations are the DropShadowable list, these are applied on the view var configurations: [DropShadowable] { get } @@ -34,7 +34,7 @@ protocol DropShadowableConfiguration { /** Extension on ViewProtocol for adding drop shadows & gradient layer on view. */ -extension ViewProtocol where Self: UIView { +public extension ViewProtocol where Self: UIView { func addDropShadow(_ config: DropShadowable) { addDropShadows([config]) @@ -47,6 +47,7 @@ extension ViewProtocol where Self: UIView { for config in configs { let shadowPath = UIBezierPath(roundedRect: bounds, cornerRadius: layer.cornerRadius) let shadowLayer = CALayer() + shadowLayer.backgroundColor = backgroundColor?.cgColor shadowLayer.shadowPath = shadowPath.cgPath shadowLayer.frame = bounds shadowLayer.position = .init(x: bounds.midX, y: bounds.midY) diff --git a/VDS/Protocols/Surfaceable.swift b/VDS/Protocols/Surfaceable.swift index 1881e3a2..cb6a664a 100644 --- a/VDS/Protocols/Surfaceable.swift +++ b/VDS/Protocols/Surfaceable.swift @@ -13,7 +13,7 @@ import VDSTokens public enum Surface: String, Equatable { case light, dark public var color: UIColor { - return self == .dark ? VDSColor.backgroundPrimaryDark : VDSColor.backgroundSecondaryLight + return self == .dark ? VDSColor.backgroundPrimaryDark : VDSColor.backgroundPrimaryLight } } diff --git a/VDS/Utilities/DropShadowConfiguration.swift b/VDS/Utilities/DropShadowConfiguration.swift index e0cc3dd8..d502a4bc 100644 --- a/VDS/Utilities/DropShadowConfiguration.swift +++ b/VDS/Utilities/DropShadowConfiguration.swift @@ -6,25 +6,26 @@ // import Foundation +import CoreGraphics /** DropShadowConfiguration confirms to DropShadowable where it has configurable properties required for drop shadow */ -final class DropShadowConfiguration: DropShadowable, ObjectWithable { +final public class DropShadowConfiguration: DropShadowable, ObjectWithable { - typealias CGFloatConfigurationValue = SurfaceConfigurationValue - typealias CGSizeConfigurationValue = SurfaceConfigurationValue + public typealias CGFloatConfigurationValue = SurfaceConfigurationValue + public typealias CGSizeConfigurationValue = SurfaceConfigurationValue ///Shadow Color configuration for light and dark surfaces - var shadowColorConfiguration: AnyColorable + public var shadowColorConfiguration: AnyColorable ///Shadow Opacity configuration for light and dark surfaces - var shadowOpacityConfiguration: CGFloatConfigurationValue + public var shadowOpacityConfiguration: CGFloatConfigurationValue ///Shadow Offset configuration for light and dark surfaces - var shadowOffsetConfiguration: CGSizeConfigurationValue + public var shadowOffsetConfiguration: CGSizeConfigurationValue ///Shadow Radius configuration for light and dark surfaces - var shadowRadiusConfiguration: CGFloatConfigurationValue + public var shadowRadiusConfiguration: CGFloatConfigurationValue - init(shadowColorConfiguration: AnyColorable = SurfaceColorConfiguration().eraseToAnyColorable(), shadowOpacity: CGFloatConfigurationValue = CGFloatConfigurationValue(1.0, 1.0), shadowOffset: CGSizeConfigurationValue = CGSizeConfigurationValue(.zero, .zero), shadowRadius: CGFloatConfigurationValue = CGFloatConfigurationValue(1.0, 1.0)) { + public init(shadowColorConfiguration: AnyColorable = SurfaceColorConfiguration().eraseToAnyColorable(), shadowOpacity: CGFloatConfigurationValue = .init(1.0, 1.0), shadowOffset: CGSizeConfigurationValue = .init(.zero, .zero), shadowRadius: CGFloatConfigurationValue = .init(1.0, 1.0)) { self.shadowColorConfiguration = shadowColorConfiguration self.shadowOpacityConfiguration = shadowOpacity self.shadowOffsetConfiguration = shadowOffset diff --git a/VDS/Utilities/SurfaceConfigurationValue.swift b/VDS/Utilities/SurfaceConfigurationValue.swift index 1b304d2a..d16ab0f8 100644 --- a/VDS/Utilities/SurfaceConfigurationValue.swift +++ b/VDS/Utilities/SurfaceConfigurationValue.swift @@ -10,10 +10,10 @@ import Foundation /** SurfaceConfiguration is a type that holds the generic datatype for light surface & dark surface and returns the value based on the surface. */ -struct SurfaceConfigurationValue { +public struct SurfaceConfigurationValue { - var lightValue: ValueType - var darkValue: ValueType + public var lightValue: ValueType + public var darkValue: ValueType public init(_ lightValue: ValueType, _ darkValue: ValueType) { self.lightValue = lightValue