Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

svg fill and color #1389

Closed
golches opened this issue Jan 14, 2018 · 10 comments
Closed

svg fill and color #1389

golches opened this issue Jan 14, 2018 · 10 comments

Comments

@golches
Copy link

golches commented Jan 14, 2018

hi everyone
i wanna thanks the developers for this library first, and i dowbloade this library since 4 days, i work with the last version of html 2canvas, and i have some difficulty, and i try to solve them, but this one i parsed google for 10 hours no solution, so the problem is in picture wich an svg, from stackoverflow logo, html2canva render it but with the wrong color

orginal picture

image

rendered picture with html2canvas

image

@Saabertooth
Copy link

Are you setting the "fill" and "color" attributes on the SVG element or setting them in a "style" attribute?

@Yuiffy
Copy link

Yuiffy commented May 17, 2018

I have the same question.
a svg with a class, there is "color: red;" in the class, but in the html2canvas result the svg is black color.
If I put a attr 'style="color: red"', it will be right.
my svg is from npm react-icons.

@jomadoye
Copy link

I have same issue.

@blendsdk
Copy link

I have the same issue. My SVG is a child element of a div. The CSS looks like:

.div-element svg {
    /* fill the nested SVG element within the DIV with red */
    fill: red
}

The rended images truns black.

Any advice?

@meehaws
Copy link

meehaws commented Jul 8, 2019

Has anyone found a workaround for this?

@Saabertooth
Copy link

Saabertooth commented Jul 8, 2019 via email

@Saabertooth
Copy link

Here you go:
#1380 (comment)

@BobaGuaca
Copy link

I get the same issue when trying to render PNGs. It's not quite as noticeable as the stackoverflow example above, but it does taint the original image enough to be obvious.

@niklasvh
Copy link
Owner

This should be fixed in the latest version

@GoChartingAdmin
Copy link

GoChartingAdmin commented Sep 25, 2021

I dont think it is fixed
white

black

Unless I am doing anything wrong, the stroke and fill of svg icons on the chart top header are taking black color instead of currentColor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants