Fill colors associated with SVG clip paths - what

2019-07-24 18:43发布

This is related to my earlier post where I try to extract vector graphics in a PDF to an SVG file. I obtained this SVG corresponding to a page in a PDF. Unfortunately, though the shapes in the SVG are correct, the fill colors seen in the PDF are not seen when the SVG is rendered by any of the standard browsers. The upper left triangle in the SVG is supposed to have a yellow fill and the lower right triangle is expected to have a light blue-green fill. I do see 2 rectangular clip paths (ids clip_2 and clip_3) in the SVG XML having these colors, but why isn't SVG rendering displaying these colors?

1条回答
Explosion°爆炸
2楼-- · 2019-07-24 19:24

From the spec:

The raw geometry of each child element exclusive of rendering properties such as ‘fill’, ‘stroke’, ‘stroke-width’ within a ‘clipPath’ conceptually defines a 1-bit mask (with the possible exception of anti-aliasing along the edge of the geometry) which represents the silhouette of the graphics associated with that element. Anything outside the outline of the object is masked out.

查看更多
登录 后发表回答