vds_ios/VDS/Utilities/SurfaceConfigurationValue.swift
Matt Bruce c00a849b11 added public to all dropshadow and fixed bug in not setting layer background color
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
2024-04-19 09:35:20 -05:00

32 lines
797 B
Swift

//
// SurfaceConfigurationValue.swift
// VDS
//
// Created by Bandaru, Krishna Kishore on 05/03/24.
//
import Foundation
/**
SurfaceConfiguration is a type that holds the generic datatype for light surface & dark surface and returns the value based on the surface.
*/
public struct SurfaceConfigurationValue<ValueType> {
public var lightValue: ValueType
public var darkValue: ValueType
public init(_ lightValue: ValueType, _ darkValue: ValueType) {
self.lightValue = lightValue
self.darkValue = darkValue
}
public init(value: ValueType) {
self.lightValue = value
self.darkValue = value
}
public func value(for object: Surfaceable) -> ValueType {
object.surface == .light ? lightValue : darkValue
}
}