我已经使用Adobe Illustrator中的钢笔工具制作了一个对象,并且我要更改笔触颜色,使25%的笔触具有颜色:#4885ed,25%的颜色具有:# 3cba54; 25%是颜色:#f4c20d,其余部分是颜色:#db3236。 有没有办法做到这一点? 对象:
答案 0 :(得分:1)
我没有为此使用Illustrator。我这样使用stroke-dasharray
和stroke-dashoffset
:
<svg viewBox="0 0 588 624" >
<style type="text/css">
<![CDATA[
#india{fill:none;stroke-dasharray:641.415 1924.245;stroke-width:5px;}
]]>
</style>
<defs>
<path id="india" d="M44.688,306.845c-2.642-0.827-5.247-1.812-7.934-2.449
c-7.525-1.783-12.961-6.64-17.922-12.115c-3.99-4.403-4.53-9.512-2.026-14.854c2.306-4.919,6.242-6.531,11.686-6.766
c6.596-0.284,13.111-2.091,19.709-2.779c5.779-0.603,11.641-0.392,17.434-0.905c2.243-0.199,5.552-0.836,6.274-2.306
c0.762-1.551-0.513-4.631-1.713-6.526c-4.985-7.873-10.5-15.416-15.369-23.356c-2.582-4.211-6.588-8.315-3.986-14.157
c3.672-8.243,8.005-16.219,17.474-18.493c4.032-0.968,9.065-0.349,12.936,1.256c4.737,1.964,8.982,2.183,12.689-0.724
c7.431-5.826,15.067-11.617,21.459-18.499c18.653-20.084,34.177-42.566,48.346-65.989c0.772-1.276,1.525-2.608,2-4.012
c1.42-4.197-1.634-9.552-6.568-9.473c-5.098,0.081-10.358-0.507-15.294-1.78c-9.525-2.458-16.651-12.229-16.92-21.806
c-0.135-4.806,1.695-8.259,5.759-10.819c5.485-3.455,6.007-9.796,1.154-14.155c-3.589-3.226-7.519-6.071-11.12-9.283
c-2.096-1.87-4.059-3.974-5.711-6.242c-6.372-8.748-5.044-17.89,3.407-24.616c18.528-14.747,52.229-12.496,67.749,5.29
c10.451,11.978,19.371,12.697,32.961,5.055c5.181-2.913,10.601-5.612,16.22-7.479c7.032-2.336,12.668,1.186,17.239,6.271
c4.494,5,6.606,10.748,4.038,17.478c-3.285,8.608-6.82,16.937-14.894,22.513c-3.8,2.625-4.026,8.368-1.061,12.65
c1.407,2.031,3.271,3.761,5.018,5.539c5.182,5.276,7.646,11.601,7.435,18.972c-0.176,6.16-2.896,9.354-8.999,9.768
c-4.456,0.302-8.995,0.254-13.428-0.248c-4.95-0.561-5.789,2.074-5.396,5.899c0.938,9.138,4.561,16.785,13.183,20.993
c8.138,3.972,13.685,10.418,18.344,17.854c4.697,7.497,6.173,15.042,0.349,22.744c-0.888,1.174-1.467,2.618-2.018,4.005
c-2.675,6.735-2.124,9.976,4.428,13.158c11.936,5.798,24.045,11.412,36.515,15.9c31.174,11.219,62.996,20.327,95.454,27.1
c7.458,1.557,10.065-0.686,9.464-8.257c-0.381-4.808-1.225-9.578-1.838-14.367c-0.826-6.456,1.912-10.525,7.25-10.812
c5.214-0.28,8.339,3.143,8.534,9.35c0.307,9.727,1.146,10.837,10.825,12.763c14.199,2.825,28.383,5.9,43.038,3.948
c5.068-0.675,8.714-3.038,10.441-7.972c0.83-2.368,0.566-3.922-2.36-4.86c-7.151-2.295-7.885-6.348-2.488-11.371
c16.909-15.742,35.395-29.299,55.974-39.831c4.674-2.392,9.838-4.258,14.99-5.198c11.271-2.059,17.596,4.958,15.109,16.187
c-0.739,3.339-1.827,6.602-2.325,10.473c3.985-6.749,10.243-7.52,16.81-7.148c6.936,0.392,10.565,6.872,6.53,12.62
c-3.886,5.536-8.651,10.566-13.595,15.22c-7.027,6.616-14.689,12.554-21.815,19.071c-1.911,1.748-3.451,4.384-4.148,6.894
c-3.555,12.812-6.272,25.877-10.297,38.531c-2.656,8.354-6.46,16.534-16.358,19.402c-1.242,0.36-2.123,3.41-2.425,5.332
c-1.729,10.997-3.026,22.064-4.924,33.03c-0.654,3.782-1.609,8.741-6.426,9.072c-4.69,0.322-5.494-4.627-7.1-7.964
c-1.657-3.444-3.028-7.025-4.541-10.54c-1.817-4.225-4.796-6.331-9.506-5.002c-4.005,1.13-7.466,0.017-9.815-3.157
c-3.326-4.494-6.88-9.039-9.045-14.112c-2.422-5.675-0.439-9.354,5.03-12.401c3.338-1.859,6.749-3.614,10.238-5.166
c4.225-1.879,7.186-8.311,4.703-12.138c-1.012-1.559-4.046-2.355-6.229-2.509c-9.259-0.653-18.662-0.158-27.786-1.56
c-10.08-1.549-12.995-5.76-13.791-14.933c-2.819-0.678-5.428-0.978-7.758-1.946c-3.211-1.335-6.172-3.258-9.314-4.774
c-3.105-1.5-5.582-0.384-7.182,2.446c-1.568,2.774-0.23,4.887,2.246,6.189c2.18,1.146,4.827,1.534,6.787,2.932
c2.116,1.509,4.573,3.565,5.166,5.832c0.411,1.571-1.626,4.534-3.356,5.782c-7.349,5.303-7.827,7.007-3.646,15.167
c7.106,13.874,9.854,28.934,11.302,44.236c1.362,14.409,0.427,15.246-13.978,16.188c-9.354,0.612-17.791,3.848-23.938,10.922
c-24.502,28.201-53.179,51.811-82.092,75.146c-14.773,11.924-29.962,23.335-45.055,34.858c-7.585,5.792-11.407,13.24-11.051,22.807
c1.154,31.017-3.308,61.434-9.899,91.609c-0.444,2.033-1.297,4.304-2.697,5.75c-9.604,9.928-18.997,20.12-29.249,29.348
c-12.313,11.082-30.903,7.563-38.812-7.06c-29.107-53.818-52.476-109.855-64.615-170.123c-5.378-26.701-8.153-53.634-6.554-80.918
c0.44-7.51-1.062-8.34-8.355-6.574c-7.409,1.794-14.955,3.111-22.502,4.226c-7.43,1.098-13.713-1.785-19.109-6.761
c-8.327-7.679-14.723-16.752-18.977-27.236c-3.496-8.616-2.476-10.235,6.58-11.689c1.636-0.263,3.285-0.45,4.928-0.673
C44.617,307.438,44.652,307.142,44.688,306.845z "/>
</defs>
<use xlink:href ="#india" stroke="#4885ed" />
<use xlink:href ="#india" stroke="#3cba54" stroke-dashoffset="641.415" />
<use xlink:href ="#india" stroke="#f4c20d" stroke-dashoffset="1282.83" />
<use xlink:href ="#india" stroke="#db3236" stroke-dashoffset="1924.245" />
</svg>
我希望这就是您所需要的。