I tried to display a spectrum of colours and am somewhat disappointed with the result.
I expected a smooth transition but found it rather lumpy.
Am I doing something wrong?
Code: Select all
<svg xmlns="http://www.w3.org/2000/svg"
version="1.1" baseProfile="full"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="1300px" height="250px"
viewBox="0 0 1300 250">
<defs>
<rect id="bx" x="0" y="0" width="150" height="100" />
<linearGradient id="r" >
<stop offset="0.0" style="stop-color: #ff0000;" />
<stop offset="1.0" style="stop-color: #ffff00;" />
</linearGradient>
<linearGradient id="y" >
<stop offset="0.0" style="stop-color: #ffff00;" />
<stop offset="1.0" style="stop-color: #00ff00;" />
</linearGradient>
<linearGradient id="g" >
<stop offset="0.0" style="stop-color: #00ff00;" />
<stop offset="1.0" style="stop-color: #00ffff;" />
</linearGradient>
<linearGradient id="c" >
<stop offset="0.0" style="stop-color: #00ffff;" />
<stop offset="1.0" style="stop-color: #0000ff;" />
</linearGradient>
<linearGradient id="b" >
<stop offset="0.0" style="stop-color: #0000ff;" />
<stop offset="1.0" style="stop-color: #ff00ff;" />
</linearGradient>
<linearGradient id="m" >
<stop offset="0.0" style="stop-color: #ff00ff;" />
<stop offset="1.0" style="stop-color: #ff0000;" />
</linearGradient>
</defs>
<g id="spectrum">
<use xlink:href="#bx" x= "50" y="50" style="fill: url(#m);" />
<use xlink:href="#bx" x= "200" y="50" style="fill: url(#r);" />
<use xlink:href="#bx" x= "350" y="50" style="fill: url(#y);" />
<use xlink:href="#bx" x= "500" y="50" style="fill: url(#g);" />
<use xlink:href="#bx" x= "650" y="50" style="fill: url(#c);" />
<use xlink:href="#bx" x= "800" y="50" style="fill: url(#b);" />
<use xlink:href="#bx" x= "950" y="50" style="fill: url(#m);" />
<use xlink:href="#bx" x="1100" y="50" style="fill: url(#r);" />
<path d="M 50,180 L 50,200 1250,200 1250,180"
style="stroke: #000; stroke-width: 2; fill: none;" />
<text x="50" y="190" style="font-Famiy: Arial; font-size; 9;">M</text>
<text x="195" y="190" style="font-Famiy: Arial; font-size; 9;">R</text>
<text x="345" y="190" style="font-Famiy: Arial; font-size; 9;">Y</text>
<text x="495" y="190" style="font-Famiy: Arial; font-size; 9;">G</text>
<text x="645" y="190" style="font-Famiy: Arial; font-size; 9;">C</text>
<text x="795" y="190" style="font-Famiy: Arial; font-size; 9;">B</text>
<text x="944" y="190" style="font-Famiy: Arial; font-size; 9;">M</text>
<text x="1095" y="190" style="font-Famiy: Arial; font-size; 9;">R</text>
<text x="1239" y="190" style="font-Famiy: Arial; font-size; 9;">Y</text>
</g>
</svg>