Update color of SVG?
See original GitHub issueIs it possible to change the color of an imported svg image based on state updates? This doesn’t work. The style is always primaryBlue even when the active value is true and the textSubdued should be applied.
<Home color={active ? primaryBlue : textSubdued} />;
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Change Color of SVG on Hover - CSS-Tricks
The way that I like to do it: 1. SVG: Make the SVG black #000000 where you want to control the color on...
Read more >Edit and Change SVG Color Online Free Without any Login
Change SVG Color Online ... DeEditor allows you to make icons from SVG files in a really simple way. Just upload, edit colors...
Read more >How to change colours of SVG graphics - Creatingo
Simply open SVG file in text/code editor, find cascading styles definition and change color code of required class. The example bellow shows how...
Read more >How to change SVG color ? - GeeksforGeeks
Example 2: In this example, we will use SVG element to draw a rectangle and color it.
Read more >How to Change SVG Colors with CSS - YourIllust
How to Change an SVG Color Directly from an SVG file · Then, press command + F for Mac, control + F for...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Sakarisson this library is using SVGR, so unfortunately we are limited to the replacement API that it offers. That means that currently you can have a fill color and replace it with another color at runtime.
If you have ideas of how to improve it, then I suggest that you open a new issue at SVGR’s repository: https://github.com/gregberge/svgr
@samridhgupta Yes, check the readme https://github.com/kristerkari/react-native-svg-transformer#changing-svg-fill-color-in-js-code