Skip to content
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

Modify SwiftUI Color extension to extend ShapeStyle #185

Merged
merged 1 commit into from
Aug 13, 2022
Merged

Modify SwiftUI Color extension to extend ShapeStyle #185

merged 1 commit into from
Aug 13, 2022

Conversation

farkasseb
Copy link
Contributor

@farkasseb farkasseb commented Aug 13, 2022

This change intends expand the usage of the generated SwiftUI color extension.

Color conforms to a bigger style called ShapeStyle and this allows us to use Colors, Gradients, Materials and more as if they were the same thing. This ShapeStyle protocol is what background uses. This allows us to use these colors everywhere SwiftUI expects a ShapeStyle to be given.
https://www.hackingwithswift.com/books/ios-swiftui/formatting-our-mission-view

Additional discussion about the topic: https://www.hackingwithswift.com/forums/100-days-of-swiftui/extending-shapestyle-for-adding-colors-instead-of-extending-color/12324

I've found that I can create custom templates via templatesPath configuration but I still believe that defaulting to this would be better overall.

@subdan
Copy link
Collaborator

subdan commented Aug 13, 2022

Thanks for the PR, @farkasseb!

@subdan subdan merged commit da39322 into RedMadRobot:master Aug 13, 2022
@farkasseb farkasseb deleted the feature/swiftui-shapestyle-color branch August 14, 2022 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants