Skip to content

Matheus2212/php-render-svg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

PHP Render SVG

Simple PHP script that uses the $_GET syntax to render a SVG image inside a <img /> tag. It applies the given collor on the fill:#{cor} inside the SVG file. Very useful for reusing the same SVG image with a different color without need to use CSS codes to change the colors.

The script doesn't have any dependency and it is really simple on usage.

For example:

<img src="path/to/render_svg.php?image=../path/to/svg/image/image.svg&collor_key=994455" />

On the SVG file, there must have:

<path style="fill:#{collor_key}" > 
  ...
</path>

Simple and easy to use.

Enjoy!

About

PHP script that renders SVG files within $_GET syntax and hex colors.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages