【发布时间】:2021-11-29 23:41:30
【问题描述】:
我需要在 SVG 中绘制不确定数量的圆圈,就像它们是单个形状一样。使所有圆圈具有相同的填充颜色不起作用,因为我需要在这些圆圈中应用过滤器,就像在图片中一样,并且您可以看到重叠区域的颜色不同。
<pattern
id="diagonalHatch"
patternUnits="userSpaceOnUse"
width="1"
height="3"
patternTransform="rotate(-45 2 2)">
<path
d="M -1,2 l 6,0"
[attr.stroke]="'#' + color"
stroke-width=".5"
/>
</pattern>
<ng-container *ngFor="let cone of cones, index as i">
<svg:circle
fill="url(#diagonalHatch)"
[attr.cx]="scaleX * (offset + cone.cX)"
[attr.cy]="cone.cY"
[attr.r]="scaleX * radius"
/>
</ng-container>
【问题讨论】:
-
这能回答你的问题吗? How can I merge two shapes in svg?
-
为什么不使用半透明的颜色来填充图案呢?然后重叠自然变暗。
标签: svg