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

Change color of SVG #5

Open
yissachar opened this issue Jun 16, 2015 · 7 comments
Open

Change color of SVG #5

yissachar opened this issue Jun 16, 2015 · 7 comments

Comments

@yissachar
Copy link

It would be nice to be able to change the fill color of an SVG. For instance:

var svg = svgView.createView({
    image: "/thing.svg",
    color: "#fff"
});

Should display the SVG as white, even if the original SVG source is not white.

@GeraudBourdin
Copy link
Owner

svg file have multiples elements with colors. Which elements do you think the module should fill ?

@yissachar
Copy link
Author

I was thinking that it would recursively change all elements to the specified color. If that doesn't make sense, can the elements be exposed so that I can manually change the color of each one myself?

My use case is pretty simple - I have an SVG that is completely black, and I sometimes want to change it to be white.

@GeraudBourdin
Copy link
Owner

this is not the goal of this module, but i'll look into it as soon as i have some time. But why d'ont you use a custom font for this or simply use 2 svg file with different colors ?

@yissachar
Copy link
Author

I could use multiple SVGs but it seems a shame to do that and add the extra size to the app when I can do it programmatically.

I originally tried custom fonts but it turns out they are broken on Android in TiSDK 4.x (see TIMOB-18968).

@GeraudBourdin
Copy link
Owner

i will look into it as soon as i have some time for it.

@falkolab
Copy link
Contributor

@GeraudBourdin
Copy link
Owner

👍 :)

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

3 participants