I am trying to change the color of clear(transparent) part inside of a SF Symbol
called delete.left.fill
. So far I've tried is as follows
Button(action: { return }, label: {
Image(systemName: "delete.left.fill")
.background(Color.black)
//.accentColor(.black)
.font(.system(size: self.fontSize*0.75))
})
.frame(width: self.width, height: self.width)
.foregroundColor(.lightGray)
//.background(Color.black)
When I run the code as above, the result is like
At first, the x
inside of the symbol was the same color as background. I want it to make black.
- I tried to set the
backgroundColor
of theButton
and it made wholeButton
black. - I tried to set
accentColor
of theImage
to black. Nothing changed. - I tried to set
backgroundColor
of theImage
to black. The result can be seen in the image.
The question is, is there a way to make just that x
, inside the symbol
, black programmatically?