diff --git a/Example/ColorfulApp/main.swift b/Example/ColorfulApp/main.swift index 6b2f77e..179343f 100644 --- a/Example/ColorfulApp/main.swift +++ b/Example/ColorfulApp/main.swift @@ -37,5 +37,7 @@ enum CompilerCheck { let view = AnimatedMulticolorGradientView() view.setColors(.appleIntelligence) view.setColors(MyPresets.white) + + _ = MulticolorGradientView() } } diff --git a/Sources/ColorfulX/MulticolorGradientView+SwiftUI.swift b/Sources/ColorfulX/MulticolorGradientView+SwiftUI.swift index acb5887..dd2d8dd 100644 --- a/Sources/ColorfulX/MulticolorGradientView+SwiftUI.swift +++ b/Sources/ColorfulX/MulticolorGradientView+SwiftUI.swift @@ -14,6 +14,14 @@ public struct MulticolorGradient: View { _parameters = parameters } + public init(parameters: MulticolorGradientView.Parameters) { + self.init(parameters: .init(get: { + parameters + }, set: { _ in + assertionFailure() + })) + } + public var body: some View { MulticolorGradientViewRepresentable(parameters: $parameters) }