Last active
January 10, 2024 04:57
-
-
Save peantunes/6c4a4b68986634ba2192e6142848bc77 to your computer and use it in GitHub Desktop.
Glow in the dark View Modifier for SwiftUI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct GlowInTheDarkViewModifier: ViewModifier { | |
let active: Bool | |
@ViewBuilder func body(content: Content) -> some View { | |
if active { | |
content | |
.shadow(color: .yellow, radius: 5) | |
.shadow(color: .white, radius: 5) | |
.shadow(color: .green, radius: 5) | |
.shadow(color: .blue, radius: 5) | |
.shadow(color: .green, radius: 5) | |
.shadow(color: .blue, radius: 5) | |
} else { | |
content | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment