Make marker-end same color as path?

2020-08-26 04:06发布

问题:

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.)

回答1:

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.



回答2:

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

I think it's a chrome bug.



标签: svg