I have a SwiftUI view that applies a fill and shadow to a shape like this:
struct ShadowRectangle: View {
let color: UIColor
var body: some View {
Rectangle()
.fill(Color(color))
.shadow(color: .red, radius: 5, x: 0, y: 0)
}
}
I have found that the fill color I use for this view can affect the way the shadow is drawn. For example:
VStack {
ShadowRectangle(color: .white)
ShadowRectangle(color: .quaternaryLabel)
}
will look like
What's going on here? How can I use UIColor.quaternaryLabel without messing up the shadow applied to the shape?
