summaryrefslogtreecommitdiff
path: root/doc/context/sources/general/manuals/svg/svg-lmtx-mozilla.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2021-03-20 01:27:42 +0100
committerContext Git Mirror Bot <phg@phi-gamma.net>2021-03-20 01:27:42 +0100
commit9fed721832d90d94caa292b8e6b7f22c88d03c3b (patch)
tree77d97c74222b17a4b80ebcdf007ad9acbc8948bf /doc/context/sources/general/manuals/svg/svg-lmtx-mozilla.lua
parent94a53123a12ab97fcf453b5893941128e8ed4d44 (diff)
downloadcontext-9fed721832d90d94caa292b8e6b7f22c88d03c3b.tar.gz
2021-03-20 01:06:00
Diffstat (limited to 'doc/context/sources/general/manuals/svg/svg-lmtx-mozilla.lua')
-rw-r--r--doc/context/sources/general/manuals/svg/svg-lmtx-mozilla.lua102
1 files changed, 102 insertions, 0 deletions
diff --git a/doc/context/sources/general/manuals/svg/svg-lmtx-mozilla.lua b/doc/context/sources/general/manuals/svg/svg-lmtx-mozilla.lua
index 802efcf3d..8bf00c72b 100644
--- a/doc/context/sources/general/manuals/svg/svg-lmtx-mozilla.lua
+++ b/doc/context/sources/general/manuals/svg/svg-lmtx-mozilla.lua
@@ -362,4 +362,106 @@ return {
<circle cx="60" cy="110" r="3" fill="red" />
</svg>
]],
+ -- https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Gradients
+ [[
+ <svg viewBox="0 0 200 100" xmlns="http://www.w3.org/2000/svg">
+ <defs>
+ <linearGradient id="gradient" x1="0%" y1="0%" x2="0" y2="100%">
+ <stop offset="0%" style="stop-color:skyblue;" />
+ <stop offset="100%" style="stop-color:seagreen;" />
+ </linearGradient>
+ </defs>
+ <rect x="0" y="0" width="100%" height="100%" fill="url(#gradient)" />
+ <circle cx="50" cy="50" r="40" fill="black" />
+ <circle cx="150" cy="50" r="40" fill="black" opacity="0.3" />
+ </svg>
+ ]],
+ [==[
+ <svg width="120" height="240" version="1.1" xmlns="http://www.w3.org/2000/svg">
+ <defs>
+ <linearGradient id="Gradient1">
+ <stop class="stop1" offset="0%"/>
+ <stop class="stop2" offset="50%"/>
+ <stop class="stop3" offset="100%"/>
+ </linearGradient>
+ <linearGradient id="Gradient2" x1="0" x2="0" y1="0" y2="1">
+ <stop offset="0%" stop-color="red"/>
+ <stop offset="50%" stop-color="black" stop-opacity="0"/>
+ <stop offset="100%" stop-color="blue"/>
+ </linearGradient>
+ <style type="text/css">
+ #rect1 { fill: url(#Gradient1); }
+ .stop1 { stop-color: red; }
+ .stop2 { stop-color: black; stop-opacity: 0; }
+ .stop3 { stop-color: blue; }
+ </style>
+ </defs>
+ <rect id="rect1" x="10" y="10" rx="15" ry="15" width="100" height="100"/>
+ <rect x="10" y="120" rx="15" ry="15" width="100" height="100" fill="url(#Gradient2)"/>
+ </svg>
+ ]==],
+ [[
+ <svg width="120" height="240" version="1.1" xmlns="http://www.w3.org/2000/svg">
+ <defs>
+ <radialGradient id="RadialGradient1">
+ <stop offset="0%" stop-color="red"/>
+ <stop offset="100%" stop-color="blue"/>
+ </radialGradient>
+ <radialGradient id="RadialGradient2" cx="0.25" cy="0.25" r="0.25">
+ <stop offset="0%" stop-color="red"/>
+ <stop offset="100%" stop-color="blue"/>
+ </radialGradient>
+ </defs>
+ <rect x="10" y="10" rx="15" ry="15" width="100" height="100" fill="url(#RadialGradient1)"/>
+ <rect x="10" y="120" rx="15" ry="15" width="100" height="100" fill="url(#RadialGradient2)"/>
+ </svg>
+ ]],
+ [[
+ <svg width="120" height="120" version="1.1"
+ xmlns="http://www.w3.org/2000/svg">
+ <defs>
+ <radialGradient id="Gradient"
+ cx="0.5" cy="0.5" r="0.5" fx="0.25" fy="0.25">
+ <stop offset="0%" stop-color="red"/>
+ <stop offset="100%" stop-color="blue"/>
+ </radialGradient>
+ </defs>
+ <rect x="10" y="10" rx="15" ry="15" width="100" height="100" fill="url(#Gradient)" stroke="black" stroke-width="2"/>
+ <circle cx="60" cy="60" r="50" fill="transparent" stroke="white" stroke-width="2"/>
+ <circle cx="35" cy="35" r="2" fill="white" stroke="white"/>
+ <circle cx="60" cy="60" r="2" fill="white" stroke="white"/>
+ <text x="38" y="40" fill="white" font-family="sans-serif" font-size="10pt">(fx,fy)</text>
+ <text x="63" y="63" fill="white" font-family="sans-serif" font-size="10pt">(cx,cy)</text>
+ </svg>
+ ]],
+ [[
+ <svg width="220" height="220" version="1.1" xmlns="http://www.w3.org/2000/svg">
+ <defs>
+ <radialGradient id="GradientPad"
+ cx="0.5" cy="0.5" r="0.4" fx="0.75" fy="0.75"
+ spreadMethod="pad">
+ <stop offset="0%" stop-color="red"/>
+ <stop offset="100%" stop-color="blue"/>
+ </radialGradient>
+ <radialGradient id="GradientRepeat"
+ cx="0.5" cy="0.5" r="0.4" fx="0.75" fy="0.75"
+ spreadMethod="repeat">
+ <stop offset="0%" stop-color="red"/>
+ <stop offset="100%" stop-color="blue"/>
+ </radialGradient>
+ <radialGradient id="GradientReflect"
+ cx="0.5" cy="0.5" r="0.4" fx="0.75" fy="0.75"
+ spreadMethod="reflect">
+ <stop offset="0%" stop-color="red"/>
+ <stop offset="100%" stop-color="blue"/>
+ </radialGradient>
+ </defs>
+ <rect x="10" y="10" rx="15" ry="15" width="100" height="100" fill="url(#GradientPad)"/>
+ <rect x="10" y="120" rx="15" ry="15" width="100" height="100" fill="url(#GradientRepeat)"/>
+ <rect x="120" y="120" rx="15" ry="15" width="100" height="100" fill="url(#GradientReflect)"/>
+ <text x="15" y="30" fill="white" font-family="sans-serif" font-size="12pt">Pad</text>
+ <text x="15" y="140" fill="white" font-family="sans-serif" font-size="12pt">Repeat</text>
+ <text x="125" y="140" fill="white" font-family="sans-serif" font-size="12pt">Reflect</text>
+ </svg>
+ ]]
}