From 6398b2ffb71678b4ce99c823fc809a6cde2e0133 Mon Sep 17 00:00:00 2001 From: Muukii Date: Wed, 4 Sep 2024 16:17:58 +0900 Subject: [PATCH] Patch --- .../Modifiers/AmbientLightModifier.swift | 42 ------------------- 1 file changed, 42 deletions(-) delete mode 100644 Sources/SwiftUISupport/Modifiers/AmbientLightModifier.swift diff --git a/Sources/SwiftUISupport/Modifiers/AmbientLightModifier.swift b/Sources/SwiftUISupport/Modifiers/AmbientLightModifier.swift deleted file mode 100644 index fb453f8f2b..0000000000 --- a/Sources/SwiftUISupport/Modifiers/AmbientLightModifier.swift +++ /dev/null @@ -1,42 +0,0 @@ - -import SwiftUI - -/** - A modifier that adds an ambient light effect to a view. - the ambient light is that made from the content with blur and modifying their color. - */ -public struct AmbientShadowModifier: ViewModifier { - - private let blurRadius: CGFloat - - public init(blurRadius: CGFloat = 10) { - self.blurRadius = blurRadius - } - - public func body(content: Content) -> some View { - - return ZStack { - content - .blur(radius: blurRadius) - .saturation(1) - .brightness(-0.2) - .scaleEffect(x: 0.9, y: 0.9, anchor: .center) - .offset(x: 0, y: 2) - .compositingGroup() - content - } - - } - -} - -// make preview -struct AmbientShadowModifier_Previews: PreviewProvider { - static var previews: some View { - Text("Hello, World!") - .font(.title) - .foregroundColor(.purple) - .modifier(AmbientShadowModifier()) - } -} -