1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
<svg id="svg-root"
width="480" height="360" viewBox="0 0 480 360"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:html="http://www.w3.org/1999/xhtml">
<g id="testmeta">
<title>Mesh gradient: Simple 2x2 patch mesh (userSpaceOnUse).</title>
<html:link rel="author"
title="Tavmjong Bah"
href="http://tavmjong.free.fr"/>
<html:link rel="help"
href="https://www.w3.org/TR/SVG2/pservers.html#MeshGradients"/>
<html:link rel="match" href="meshgradient-basic-003-ref.png" />
</g>
<style id="test-font" type="text/css">
/* Standard Font (if needed). */
@font-face {
font-family: FreeSans;
src: url("../fonts/FreeSans.woff") format("woff");
}
text {
font-family: FreeSans, sans-serif;
text-anchor: middle;
fill: black;
}
#title {
font-size: 24px;
}
.label {
font-size: 18px;
}
</style>
<defs>
<meshgradient id="LinearMesh" x="20" y="140" gradientUnits="userSpaceOnUse">
<meshrow>
<meshpatch>
<stop style="stop-color:#0000ff" path="l 100,0" />
<stop style="stop-color:#00ff00" path="l 0,100" />
<stop style="stop-color:#ffff00" path="l -100,0" />
<stop style="stop-color:#00ff00" path="l 0,-100" />
</meshpatch>
<meshpatch>
<stop path="l 100,0" />
<stop style="stop-color:#ffff00" path="l 0,100" />
<stop style="stop-color:#0000ff" path="l -100,0" />
<!-- No final stop -->
</meshpatch>
</meshrow>
<meshrow>
<meshpatch>
<!-- No initial stop -->
<stop path="l 0,100" />
<stop style="stop-color:#0000ff" path="l -100,0" />
<stop style="stop-color:#ffff00" path="l 0,-100" />
</meshpatch>
<meshpatch>
<!-- No initial stop -->
<stop path="l 0,100" />
<stop style="stop-color:#00ff00" path="l -100,0" />
<!-- No final stop -->
</meshpatch>
</meshrow>
</meshgradient>
<meshgradient id="BezierMesh" x="260" y="140" gradientUnits="userSpaceOnUse">
<meshrow>
<meshpatch>
<stop style="stop-color:#0000ff" path="c 33.33,0 66.67,0 100,0" />
<stop style="stop-color:#00ff00" path="c 0,33.33 0,66.67 0,100" />
<stop style="stop-color:#ffff00" path="c -33.33,0 -66.67,0 -100,0" />
<stop style="stop-color:#00ff00" path="c 0,-33.33 0,-66.67 0,-100" />
</meshpatch>
<meshpatch>
<stop path="c 33.33,0 66.67,0 100,0" />
<stop style="stop-color:#ffff00" path="c 0,33.33 0,66.67 0,100" />
<stop style="stop-color:#0000ff" path="c -33.33,0 -66.67,0 -100,0" />
<!-- No final stop -->
</meshpatch>
</meshrow>
<meshrow>
<meshpatch>
<!-- No initial stop -->
<stop path="c 0,33.33 0,66.67 0,100" />
<stop style="stop-color:#0000ff" path="c -33.33,0 -66.67,0 -100,0" />
<stop style="stop-color:#ffff00" path="c 0,-33.33 0,-66.67 0,-100" />
</meshpatch>
<meshpatch>
<!-- No initial stop -->
<stop path="c 0,33.33 0,66.67 0,100" />
<stop style="stop-color:#00ff00" path="c -33.33,0 -66.67,0 -100,0" />
<!-- No final stop -->
</meshpatch>
</meshrow>
</meshgradient>
</defs>
<g id="test-body-content">
<rect x="20" y="140" width="200" height="200" style="fill:url(#LinearMesh)" />
<rect x="260" y="140" width="200" height="200" style="fill:url(#BezierMesh)" />
</g>
</svg>
|