I'm having trouble exporting SVGs to have a black fill (fill="#000000). I am able to export an SVg to have any other color except a black one. I am exporting as Format: SVG using artboards (1). I am using SVG options:
Styling: Inline Style
Object IDs: Layer Names
(as screenshoted below)
And the results in VS Code as shown below (no fill in code):
And results of exporting in same settings with any other color:
Any reason why it won't export with a black fill?
Can you post the appearance panel of the original file?
Sure thing! Here's the appearance panel
OK, that's weird.
Before resetting the preferences ... can you check the color management settings?
And also: which color profile is attached to the document? It's unlikely, but possible that color management does this. But those color profiles are experimental ones.
If color management is set up correctly, then can you try if "Export for screens" does the same? You have crrently used "Save as", right?
If that doesn't work, then probably the preferences are causing it. You can try and rename the folder, so it can be reverted. https://helpx.adobe.com/illustrator/using/setting-preferences.html
I'm having the same issue as @DavyMJones , in case it's helpful to know that this isn't an isolated case @Monika Gause! True black refuses to be registered as a fill on export (using either 'Export as..' or 'Export for Screens...').
Here's a screengrab of the proposed code generated by a simple set of shapes and paths on my machine, without any fill styling in the SVG code output for either of the #000 filled shapes (you can see the fill is present for the non-black shape):
The color profile isn't anything odd (I think):
And again: which color profile is attached to the file?
What's in the appearance panel?
How do you export the file?
And yes: yours are isolated cases.
Did you already reset the preferences? You can try by renaming the folder. https://helpx.adobe.com/illustrator/using/setting-preferences.html
Sorry. As Ton mentioned, black seems to never be defined in a fill.
I somehow got diverted by the green shapes in both posts.
It looks like you cannot force Illustrator to create a black fill e.g. by applying the registration swatch or by applying a blend mode. So the only solution seems to be to report it as a bug to http://illustrator.uservoice.com
Thank you @Monika Gause (and @Ton Frederiks ) for the feedback! In my specific case, I'm a software developer trying to find a way to reliable render SVG's exported from illustrator into a generated PDF, and for whatever reasons browsers are able to guess properly about a black fill, but the pdf library wasn't. We were able to use an unrelated work around to show the images (rendering them in a browser canvas and then printing a png/jpg of the canvas to the PDF rather than trying to render an SVG itself in the pdf). Thanks for the link to the bug report, though, I suppose it might be worth filling one out just in case it helps somebody else (including the OP) 🙂
So that PDF is meant for specific printing processes (or even ebook) that don't allow placed PDFs in them?
I don't quite understand that workaround of rendering an SVG and then exporting a JPG from a browser instead of exporting it directly from Illustrator.
It does not seem to matter for the display of the fill, but a black fill is not defined.
A black stroke is saved. And that is the behaviour since at least CS4.
Opening a file in Inkscape shows Paint is undefined for the black fill.