Can't export SVGs to have a fill="#000000" (black)

New Here ,
Apr 23, 2021 Apr 23, 2021

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)

Davy5F96_2-1619195214128.png

And the results in VS Code as shown below (no fill in code):

Davy5F96_3-1619195547286.png

And results of exporting in same settings with any other color:

Davy5F96_5-1619195671170.pngDavy5F96_4-1619195638491.png

Any reason why it won't export with a black fill?

TOPICS
Bug, Feature request, Import and export

Views

617

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Apr 23, 2021 Apr 23, 2021

Copy link to clipboard

Copied

Can you post the appearance panel of the original file?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 23, 2021 Apr 23, 2021

Copy link to clipboard

Copied

Sure thing! Here's the appearance panel

DavyMJones_0-1619199994228.png

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Apr 24, 2021 Apr 24, 2021

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 10, 2021 May 10, 2021

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):

Josiah5C26_1-1620688159992.png

 

The color profile isn't anything odd (I think):

Josiah5C26_0-1620688137157.png

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
May 11, 2021 May 11, 2021

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
May 11, 2021 May 11, 2021

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 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 11, 2021 May 11, 2021

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) 🙂

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
May 12, 2021 May 12, 2021

Copy link to clipboard

Copied

LATEST

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
May 11, 2021 May 11, 2021

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines