240 shaares
As far as I know, there is no way to put a gradient along a path using Inkscape. Here is a convoluted workaround that can be used, considering a linear gradient with only two stops:
- Create the path you want
- Create a closed path that will be repeatedly copied for the full path length (which means we are somehow discretizing the path)
- Copy this second path to the clipboard
- Select the first path, and open the Path Effects window (menu Path → Path effects)
- Choose the effect "Pattern along path"
- Configure the pattern copies to "Repeated, steched"
- Tune the parameters so the paterns trustfully follow your path the way you want
- In the dropdown menu next to the
👁️
and🗑️
icons, select "Flatten": it will apply the effect to the path (meaning that the path won't exist anymore, and the object copies will be created in your document for real) - Group all the copies together
- In menu Extensions, select "Style" → "Interpolate attribute in a Group"
- Set "Attribute to interpolate" to "Fill", and choose your "Start Value" and "End Value" to the colors you want.
And you are done!
EDIT: Similar approach but different:
https://m.youtube.com/watch?v=RoIEZBXO0eQ
In short, create as many shapes (circles) as gradient stops, convert them to paths, colorize them, select them and use the "Interpolate" extension, group them all, and use the "Bend" path effect to apply the gradient of circles along the path.