meyfa / php-svg

Vector graphics (SVG) library for PHP
https://packagist.org/packages/meyfa/php-svg
MIT License
519 stars 93 forks source link

linearGradient support #53

Open darkomenx opened 6 years ago

darkomenx commented 6 years ago

I would like to generate à Rect object SVG and filling this with a linearGradient color like this

https://www.w3schools.com/graphics/svg_grad_linear.asp

Generate this kind of code

`

`

I don't understand how can do this with your library.

Can you help me to generate this please ?

meyfa commented 6 years ago

This is not possible yet, as <linearGradient> elements (and everything they need to function) are not implemented. I will keep this issue open until gradient support is added, so you will know when it's there. But, I am afraid this library can't do this right now.

GoTeamScotch commented 5 years ago

Just wanted to add that this specific feature prevents me from using this library in my application. I wish you good luck nailing down this issue in coming releases.

rickerd commented 5 years ago

I would like this feature too

meyfa commented 4 years ago

For what it's worth, a barebones SVG\Nodes\Presentation\SVGLinearGradient and SVG\Nodes\Presentation\SVGStop were added in 0bf3d0fd9160818ae4501dee2aa61b770f75b645.

The rasterizer implementation still needs to happen, which is likely a long way off because PHP GD has no gradient support whatsoever and it needs to be manually written.

JukkaHau commented 4 years ago

upvote this!

Or would it be possible to use png-file to fill the area ?