I’d like to modify the color of Image
s in SwiftUI. Currently, I’m trying to modify the .foregroundColor()
as such, but it’s not actually modifying it whatsoever from black
Image(uiImage: resizeImage(UIImage(systemName: isLiked ? "heart.fill" : "heart")!,
targetSize: CGSize(width: 75, height: 27))!)
.foregroundColor(isLiked ? .yellow : .gray)
As you can see, the color is still black:
Ideally, I’d want to modify it to have this .foregroundColor
, that is the color of its outline, and when the like button (heart) is pressed, it fills with that same color:
foregroundColor(colorPalettes[safe: sharedVars.colorPaletteIndex]?[2] ?? .white)
This is currently the color being applied to the like count next to the like button (heart image):