Make marker-end same color as path?

2020-08-26 03:34发布

The path has a certain stroke color which may change programatically. Can the marker's fill also be the exact same as the path's stroke color? (I'll use javascript for this if I have to.)

标签: svg
2条回答
Luminary・发光体
2楼-- · 2020-08-26 04:05

Markers are independent from the paths they are applied to and don't inherit colours. Nor is there a way to automatically have their colours match the path.

You will have to set their colour explicitly.

查看更多
Root(大扎)
3楼-- · 2020-08-26 04:05

IE and Firefox render markers color inherited from path, but Chrome does not.

I think it's a chrome bug.

查看更多
登录 后发表回答