Closed qzoushi closed 3 years ago
试试这个:https : //svgjs.com/docs/3.0/shape-elements/#gradient-constructor Using the official API (add) will not work, while using at to add linear gradients will work
What does not work? Example please!
什么不起作用?请举个例子!
this is not work var gradient = draw.gradient('linear', function(add) { add.stop(0, '#333') add.stop(1, '#fff') })
this is work var gradient = draw.gradient('linear', function(add) { add.at(0, '#333') add.at(1, '#fff') })
are you using the latest version svg.js v3?
After I created the linear gradient in svg.js, it didn't work on the element, and I configured the color cutoff for the linear gradient, but I didn't find the stop in the code