-
-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Striped style with gradient #78
Comments
It is currently not, no. Your approach there is definitely the most straightforward one. The only other option currently to change the rendering - which is really only useful for much more complex use cases - would be to implement your own I'm still planning to make the SwiftUI version "a lot more native", using Using the mask as you did should be more than suitable for most use cases for the time being. |
The interface could arguably be a little simpler: - `Style` should be reduced to `.solid` and `.striped` - the actual styling could then be simplified to solely rely on SwiftUI Shape modifiers However, while we still allow the creation of `UIImage` / `NSImage` as well as support `UIKit`, we can't really simplify this without too much effort in the legacy (`UIKit` code), which feels like a waste of time. Instead, probably UIKit support should be dropped at some point in the future and the interface be overhauled for modern iOS. Once released, this would allow #78 to be done more natively.
@cyrilzakka see my commit message above. You'll soon be able to just do the following. It's a little cumbersome, because the colors from the config are essentially being ignored. As mentioned in the commit message, I can't really change that without breaking the existing API horribly. So for the time being this should be seen as an optional style override for cases like yours. Arguably I don't feel it improved the situation much 😅 But it's a required way regardless on the way of making this library more native in SwiftUI, so I went with it anyway. WaveformView(audioURL: audioURL, configuration: .init(style: .striped(.init(color: .black)))) { shape in
shape // override the shape styling
.stroke(LinearGradient(colors: [.blue, .pink], startPoint: .bottom, endPoint: .top), lineWidth: 3)
} |
Hello,
It is possible to adopt the striped style while still maintaining a gradient? As far as I can tell it doesn't seem to be natively supported so I've done the following:
Thanks!
The text was updated successfully, but these errors were encountered: