SVG圆形滑块颜色变化

时间:2018-08-06 23:39:20

标签: javascript css svg svg-animate clip-path

我有以下svg,我想创建一个圆形滑块, 问题是我找不到与改变有关的任何东西 图像部分的笔触颜色。

<svg width="221px" height="221px" viewBox="0 0 221 221" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
          <pattern id="pattern" width="100%" height="100%">
            <path  d="M110.5,221 C171.527465,221 221,171.527465 221,110.5 C221,49.4725351 171.527465,0 110.5,0 C49.4725351,0 0,49.4725351 0,110.5 C0,171.527465 49.4725351,221 110.5,221 Z"
              id="path-1"></path>

            <use xlink:href="#path-1"></use>
            </mask>
          </pattern>
          <defs>
           

            <path d="M110.5,221 C171.527465,221 221,171.527465 221,110.5 C221,49.4725351 171.527465,0 110.5,0 C49.4725351,0 0,49.4725351 0,110.5 C0,171.527465 49.4725351,221 110.5,221 Z"
              id="path-1"></path>
            <mask id="mask-2" maskContentUnits="userSpaceOnUse" maskUnits="objectBoundingBox" x="0" y="0" width="221" height="221" fill="white">
              <use xlink:href="#path-1"></use>
            </mask>
          </defs>
          <g id="Final" stroke="none" stroke-width="1" fill="url(#psattern)" fill-rule="evenodd" opacity="0.69921875" stroke-dasharray="1,4">
            <g id="voor" transform="translate(-77.000000, -230.000000)" stroke="#F5A623" stroke-width="48">
              <g id="fi-strokes" stroke-width="48">

                <g id="Gup" transform="translate(0.000000, -44.000000)">

                  <g id="Gup-5" transform="translate(20.000000, 111.000000)">
                    <g id="rp-4">
                      <g id="und" transform="translate(57.000000, 163.000000)">
                        <g id="reen">
                          <g id="Dl">
                            <g id="faded-ts">
                              <use id="Oval" mask="url(#mask-2)" xlink:href="#path-1"></use>
                            </g>
                          </g>
                        </g>
                      </g>
                    </g>
                  </g>
                </g>
              </g>
            </g>
          </g>
        </svg>

如何将鼠标/触摸事件中的图像的一部分更改为另一种颜色? 我尝试过:

  1. 剪切路径-我无法创建平滑的颜色更改。
  2. 线性梯度-相同的问题

有提示吗?

0 个答案:

没有答案