SwiftUI darken modifier

Viewed 3991

SwiftUI has a helpful ViewModifier called brighten, does anyone know how to do the opposite and darken a view? I'd hoped passing in a negative value would do the trick, but that doesn't work.

1 Answers

For darken the View, You can give negative value to brightness modifier like this,

MyView().brightness(-0.5)
Related