I've a SVG file (heart shape) which I have imported in my project in Adobe Indesign.
I need to change the color of the heart to a specific color so the presser will add foil on that specific place.
How can I change the color of this heart object?
When I change the color of the object, the entire box will get the color instead of just the heart shape, see image below.
I tried adding a path to the existing heart but that is not exactly matching with the shapes and looks really messy.
The desired result is having a heart shape in the foil color without the bounding box.
You'll need to change the color in the original application where you created the .svg, or draw a new heart using the pen tool in InDesign.
Well, maybe one other possibility...
Have you tried selecting the .svg with the direct select tool? If you are able to do that and it selects the path of the heart you might be able to redefine the color. There is a complication, however. your color needs to be a spot color to create a foil die, and it doesn't look like you've got it defined that way.
If the exisitng heart is defined with a spot color fill (apparently called Named Color in the SVG Spec) you can use the Ink Manager to alias the exisiting spot color (presuming it is not used elsewhere in the document) to your foil color. If the exisiting fill color for the heart is not showing in the Swatches panel, try Add Unnamed Colors from the panel menu. I think, though, that any defined spot color would create a swatch automaticaslly on import, so this probably will not help.
To change the color of that SVG file you have to open it with e.g. Adobe Illustrator.
Two options now:
 Change the color in Illustrator and save it as AI file. Place the AI file in InDesign.
 Copy the path of the heart shape in Illustrator and paste the copied path in InDesign and change the color with InDesign.
FWIW: SVG files cannot be saved as SVG with a spot color or a CMYK color.
( ACP )
I've managed to save spot color as .svg in Illustrator, but it does not come into ID with the spot color intact, so I guess Uwe is correct on your options.