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

linearGradient support #53

Open
darkomenx opened this issue May 30, 2018 · 5 comments
Open

linearGradient support #53

darkomenx opened this issue May 30, 2018 · 5 comments
Labels
feature New feature or request

Comments

@darkomenx
Copy link

darkomenx commented May 30, 2018

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

<defs> <linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="0%"> <stop offset="0%" style="stop-color:rgb(255,255,0);stop-opacity:1" /> <stop offset="100%" style="stop-color:rgb(255,0,0);stop-opacity:1" /> </linearGradient> </defs> <ellipse cx="200" cy="70" rx="85" ry="55" fill="url(#grad1)" />

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

Can you help me to generate this please ?

@meyfa meyfa changed the title example for linearGradient linearGradient support May 31, 2018
@meyfa meyfa added the feature New feature or request label May 31, 2018
@meyfa
Copy link
Owner

meyfa commented May 31, 2018

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
Copy link

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
Copy link

rickerd commented Nov 12, 2019

I would like this feature too

@meyfa
Copy link
Owner

meyfa commented Sep 6, 2020

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

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
Copy link

upvote this!

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants