# Request for SVG Gradient file

**URL:** <https://discourse.processing.org/t/request-for-svg-gradient-file/12116>\
**Category:** Coding Questions\
**Created:** [June 17, 2019, 10:06am UTC](https://discourse.processing.org/t/request-for-svg-gradient-file/12116 "2019-06-17T10:06:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![clankill3r](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/clankill3r/32/1098_2.png) [@clankill3r](https://discourse.processing.org/u/clankill3r)\
**Post date:** [June 17, 2019, 10:06am UTC](https://discourse.processing.org/t/request-for-svg-gradient-file/12116/1 "2019-06-17T10:06:36Z")

</div>

Could someone provide me a svg with a gradient that works in processing?  
I wan’t to see if I can make processing support svg gradients from svg’s exported from affinity designer, but it would be really helpfull to have a svg that works from another application first.

---

<div class="post-metadata">

**Author:** ![tribblesontoast](https://avatars.discourse-cdn.com/v4/letter/t/e99b99/32.png) [@tribblesontoast](https://discourse.processing.org/u/tribblesontoast)\
**Post date:** [June 25, 2019, 10:43am UTC](https://discourse.processing.org/t/request-for-svg-gradient-file/12116/2 "2019-06-25T10:43:06Z")

</div>

Can’t upload svg to these forums so I uploaded it to fileDropper.  
You’ll need to display this as a PShape as PImage doesn’t support svg.

[http://www.filedropper.com/processingfriendlysvg](http://www.filedropper.com/processingfriendlysvg)

Edit: Should have said, file created with Illustrator CC 2019

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [June 26, 2019, 2:37am UTC](https://discourse.processing.org/t/request-for-svg-gradient-file/12116/3 "2019-06-26T02:37:49Z")

</div>

thanks @tribblesontoast, works here with this code

```auto
String filebg = "data/processingFriendlySVG.svg";
PShape getsvg;

void setup() {
  size(500, 500);
  getsvg = loadShape(filebg);
}

void draw() {
  shape(getsvg, 0, 0, width,height); 
}

```

and it can be posted here as code too!  
file: processingFriendlySVG.svg

```auto
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 22.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
	 width="800px" height="800px" viewBox="0 0 800 800" enable-background="new 0 0 800 800" xml:space="preserve">
<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="1.077515e-07" y1="400" x2="800" y2="400">
	<stop offset="0" style="stop-color:#9E1F63"/>
	<stop offset="1" style="stop-color:#D7DF23"/>
</linearGradient>
<rect x="0" fill="url(#SVGID_1_)" width="800" height="800"/>
</svg>

```

and looks like:

 ![SNAG-0130](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/2/28725fdf0f7fd929733f1e12d3c48db755da5c91.jpeg)

* * *

if no tools like Adobe Illustrator available, try to make the SVG source code [here](https://www.w3schools.com/graphics/svg_grad_linear.asp)

---

<div class="post-metadata">

**Author:** ![clankill3r](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/clankill3r/32/1098_2.png) [@clankill3r](https://discourse.processing.org/u/clankill3r)\
**Post date:** [September 2, 2019, 12:17pm UTC](https://discourse.processing.org/t/request-for-svg-gradient-file/12116/4 "2019-09-02T12:17:15Z")

</div>

Both thanks. I’m not gonna need it anymore. The difference between JAVA2D and P2D are big when dealing with SVG. And in general it is really specific what created the SVG. I think in general SVG is a great idea but horribly executed.

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [September 2, 2019, 6:02pm UTC](https://discourse.processing.org/t/request-for-svg-gradient-file/12116/5 "2019-09-02T18:02:55Z")

</div>

One of the main issues is that the SVG spec is massive, and was designed in 1998-2000, and has only very partial support in Processing. Here’s an old interview to give you some of the flavor of that history: [https://www.adobe.com/devnet/svg/articles/svg-jon-ferraiolo-interview.html](https://www.adobe.com/devnet/svg/articles/svg-jon-ferraiolo-interview.html)

…and developing support for various advanced SVG features across various browsers has been a two decade project that is ongoing:

[https://caniuse.com/#search=SVG](https://caniuse.com/#search=SVG)
