Copy link to clipboard
Copied
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
Font: SVG
Image: Preserve
Object IDs: Layer Names
Decimal: 5
Minify: checked
Responsive: checked
(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?
Copy link to clipboard
Copied
Can you post the appearance panel of the original file?
Copy link to clipboard
Copied
Sure thing! Here's the appearance panel
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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):
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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) 🙂
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
I'm experiencing the same issue repeatedly. How can I fix this precisely? Whenever I upload my logo as an SVG file on my website, it appears blank or grey. Any color I use besides black displays correctly. Strangely, the logo shrinks, and when I change the fill color, it maintains the same measurements.
Copy link to clipboard
Copied
Hello @YJYJ,
Sorry to hear about your experience. Would you mind sharing more details, like the exact version of the OS/Illustrator, details about your workflow, and a sample file (https://adobe.ly/3TEP6Cd), so we can investigate this further?
Looking forward to hearing from you.
Thanks,
Anubhav
Copy link to clipboard
Copied
Hello @Anubhav M I'm experiencing a similar issue. As a graphic designer, I'm encountering a problem where the color black (#000000) doesn't display correctly on the front end, despite being selected. The design is supposed to have color options. Other colors work fine, and my colleague doesn't seem to have the same issue. I've already attempted resetting the preferences, but the problem persists. Any suggestions for resolving this?
Copy link to clipboard
Copied
Please check out Ton's answer at the very bottom of this page.
Copy link to clipboard
Copied
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.