SVG line with the multiline pattern -
i need svg path which'd using line following 'pattern' line: 5 pixels width, 1 pix green line followed 3 pix white line followed 1 pix green line again. know can kind of accomplish drawing 3 paths using green, white , green colors , small offsets, i'm looking way in 1 go if possible.
clarification:
imagine have 3 pens 3 different colors bound can use them one. want draw arbitrary path using 3 color pen specifying path data once.
you can achieve "3 pen effect" defining base path
once, , use
path several times different x
, y
offsets , other settings (such stroke
):
<svg width="200" height="170"> <defs> <path id="pattern" d="m10 80 c 40 10, 65 10, 95 80 s 150 150, 180 80" fill="none" /> </defs> <g stroke-width="2"> <use xlink:href="#pattern" x="0" y="0" stroke="red" /> <use xlink:href="#pattern" x="5" y="0" stroke="green" stroke-width="4" /> <use xlink:href="#pattern" x="10" y="0" stroke="blue" /> </g> </svg>
Comments
Post a Comment