All examples By author By category About

tomshanley

Area segment fill using gradient

Suggested answer to an SO question on filling a segment of an area between two paths

A linearGradient is created and used as fill on the area between two lines. And then a rect with 0 opacity has mousemove event attached, which uses the mouse's position to update a linearGradient's offsets' proportions.

Built with blockbuilder.org

forked from tomshanley's block: Area segment fill using gradient, to include a line on each side of the gradient fill, that gets is y1/y2 coordinates from for loop that traverses each path.

forked from tomshanley's block: Area segment fill using gradient