Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Calculadora

0

61
Vistas
How to change color of this SVG?

I've tried multiple methods of changing this SVG's color but I cannot find a solution.

Thank you in advance, it's really appreciated!

<svg width="30" height="42" viewBox="0 0 30 42" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  <rect width="30" height="42" fill="url(#pattern0)"/>
  <defs>
    <pattern id="pattern0" patternContentUnits="objectBoundingBox" width="1" height="1">
      <use xlink:href="#image0" transform="translate(-0.327273) scale(0.0212121 0.0151515)"/>
    </pattern>
    <image id="image0" width="78" height="66" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE4AAABCCAYAAAD5aOBmAAAClklEQVR4Xu3bPasTQRQG4PfNTAIqaGHhHxDLi1pbeUELi/sX/GgtBFsrf4AfpdjY3MJCG8VaBMFCxM7Gj8biNlqICiEze+RChNzFsLMnWbMJb9qcd3bmyUl22cwSerkE6EopBME5m0BwgnMKOGPqOME5BZwxdZzgnALOWCcdNx6Pt0IItwFcAHAIwEeSDwaDwX2SE+dcexVbOtxkMtkm+WwKVl/sixDCDsnUKwXHZJYKZ2aHc86fAZyYNxeSN0MIdxxz7VWkGC7n/L5p5mZ2BMDJhrqfJD81jbWK90MIp0uPWwyXUrLSQde1LsZY7FFcKLiD7VAMl3O+0dRJVVUdJ3mroe4tyd2msVbxfgjhXulxi+FKB0wpPQdwaU59rqrq3Gg0elM6Xl/rlg5nZsdyzk8BnK8t+jeAqzHGx33FaDOvpcPtH9zMmFK6uH8BTPIoyQ+DwWCX5F6byfW5thO4Pi94WXMTnFNScIJzCjhj6jjBOQWcMXWc4JwCzpg6bt3hprfbr5M8a2bJzF7HGO+S/OpcW6exXnRcSukKgIcAQm21P8xsZzgcvuxUwTH4yuGmnfbuH2h/l/M9hHCK5DfH+jqLFMOllB51MQuSZ8xsq2HsVwC+dHH82TFjjJdLj9EGTrfOZ1QFN4PR1X8O+qp6Oq70u9+2buNPDm1B2tTrcqSNVq1WF8AL4K1TtPisuk6L+h9zFZxTWXCCcwo4Y+o4wTkFnDF1nOCcAs5YJx2nTTeOT2O6zesJgO1a/BeAa9rmNQdVGwtrMNrKehCk+DdOm6cFN/eXu5Nb53pAxNlxJSdYPZJUojSnRg/BLYCnxy4XwNv0aPHlyKZDtF2f4NqKTesFJzingDOmjhOcU8AZU8cJzingjP0Bj7/mQwtY53EAAAAASUVORK5CYII="/>
  </defs>
</svg>

7 months ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Alright so after hours of googling and researching, I decoded the base64 png manually and converted it to a PNG file. Thereafter I changed the color of the PNG, to save it and encode it back again.

I would totally recommend this solution for anyone struggling with the same problem!

7 months ago · Juan Pablo Isaza Denunciar

0

You can change colors by css filter.

body {
  background-color: #000;
}

svg image {
  filter: invert(0.75) sepia(1) hue-rotate(180deg) saturate(1000%);
}

.fontAwesome {
  color: blue;
  display: inline-block;
  width: 1em;
  font-size: 32px;
}
<svg width="30" height="42" viewBox="0 0 30 42" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  <rect width="30" height="42" fill="url(#pattern0)"/>
  <defs>
    <pattern id="pattern0" patternContentUnits="objectBoundingBox" width="1" height="1">
      <use xlink:href="#image0" transform="translate(-0.327273) scale(0.0212121 0.0151515)"/>
    </pattern>
    <image id="image0" width="78" height="66" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE4AAABCCAYAAAD5aOBmAAAClklEQVR4Xu3bPasTQRQG4PfNTAIqaGHhHxDLi1pbeUELi/sX/GgtBFsrf4AfpdjY3MJCG8VaBMFCxM7Gj8biNlqICiEze+RChNzFsLMnWbMJb9qcd3bmyUl22cwSerkE6EopBME5m0BwgnMKOGPqOME5BZwxdZzgnALOWCcdNx6Pt0IItwFcAHAIwEeSDwaDwX2SE+dcexVbOtxkMtkm+WwKVl/sixDCDsnUKwXHZJYKZ2aHc86fAZyYNxeSN0MIdxxz7VWkGC7n/L5p5mZ2BMDJhrqfJD81jbWK90MIp0uPWwyXUrLSQde1LsZY7FFcKLiD7VAMl3O+0dRJVVUdJ3mroe4tyd2msVbxfgjhXulxi+FKB0wpPQdwaU59rqrq3Gg0elM6Xl/rlg5nZsdyzk8BnK8t+jeAqzHGx33FaDOvpcPtH9zMmFK6uH8BTPIoyQ+DwWCX5F6byfW5thO4Pi94WXMTnFNScIJzCjhj6jjBOQWcMXWc4JwCzpg6bt3hprfbr5M8a2bJzF7HGO+S/OpcW6exXnRcSukKgIcAQm21P8xsZzgcvuxUwTH4yuGmnfbuH2h/l/M9hHCK5DfH+jqLFMOllB51MQuSZ8xsq2HsVwC+dHH82TFjjJdLj9EGTrfOZ1QFN4PR1X8O+qp6Oq70u9+2buNPDm1B2tTrcqSNVq1WF8AL4K1TtPisuk6L+h9zFZxTWXCCcwo4Y+o4wTkFnDF1nOCcAs5YJx2nTTeOT2O6zesJgO1a/BeAa9rmNQdVGwtrMNrKehCk+DdOm6cFN/eXu5Nb53pAxNlxJSdYPZJUojSnRg/BLYCnxy4XwNv0aPHlyKZDtF2f4NqKTesFJzingDOmjhOcU8AZU8cJzingjP0Bj7/mQwtY53EAAAAASUVORK5CYII="/>
  </defs>
</svg>

<p class="fontAwesome slider-h">
  <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="sliders-h" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="svg-inline--fa fa-sliders-h fa-w-16 fa-3x"><path fill="currentColor" d="M496 384H160v-16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h80v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h336c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-160h-80v-16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h336v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h80c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-160H288V48c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16C7.2 64 0 71.2 0 80v32c0 8.8 7.2 16 16 16h208v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h208c8.8 0 16-7.2 16-16V80c0-8.8-7.2-16-16-16z" class=""></path>
  
</svg>

</p>

Better use vector icon libraries like fontAwesome, feather icons etc. They offer a superior quality in any size and can be colored by fill or color attribute.

See also:

How to change the color of an svg element?

7 months ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar empleo Planes Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2023 PeakU Inc. All Rights Reserved.