native first
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
public struct OverlaySettings: Equatable {
|
||||
public static let minimumOpacity = 0.35
|
||||
public static let maximumOpacity = 0.95
|
||||
public static let `default` = OverlaySettings(backgroundOpacity: 0.72)
|
||||
|
||||
public let backgroundOpacity: Double
|
||||
|
||||
public init(backgroundOpacity: Double) {
|
||||
self.backgroundOpacity = Self.clamp(backgroundOpacity)
|
||||
}
|
||||
|
||||
public static func clamp(_ opacity: Double) -> Double {
|
||||
min(maximumOpacity, max(minimumOpacity, opacity))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user