Created
February 16, 2025 17:10
-
-
Save glenngijsberts/b8cc1c3dee67fc83f5c581a4e51d91a2 to your computer and use it in GitHub Desktop.
SwiftUI DatePicker Color
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
| import SwiftUI | |
| private struct DatepickerColor: ViewModifier { | |
| let color: Color | |
| func body(content: Content) -> some View { | |
| content | |
| .colorScheme(.dark) | |
| .colorMultiply(color) | |
| } | |
| } | |
| public extension DatePicker { | |
| func datepickerColor(_ color: Color) -> some View { | |
| self.modifier(DatepickerColor(color: color)) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment