You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I used a gradient on a path and called path's fillColor.exportJSON(), now after some manipulation, I am trying to reload the new gradient string in the path's fillColor but It seems that fillColor and strokeColor only provide exportJSON but not importJSON, so setting gradient string to the fillColor property seems not possible.
var gradientString = '[["dictionary",{"#12":["Gradient",[[[0.41569,1,0.27059],0.6],[[0.14118,0.54118,1],"0.7"]],false]}],["gradient",["#12"],[100,100],[300,200]]]';
I tried as follows
path.fillColor = gradientString;
and
path.fillColor = JSON.parse(gradientString);
The text was updated successfully, but these errors were encountered:
I used a gradient on a path and called path's fillColor.exportJSON(), now after some manipulation, I am trying to reload the new gradient string in the path's fillColor but It seems that fillColor and strokeColor only provide exportJSON but not importJSON, so setting gradient string to the fillColor property seems not possible.
var gradientString = '[["dictionary",{"#12":["Gradient",[[[0.41569,1,0.27059],0.6],[[0.14118,0.54118,1],"0.7"]],false]}],["gradient",["#12"],[100,100],[300,200]]]';
I tried as follows
path.fillColor = gradientString;
and
path.fillColor = JSON.parse(gradientString);
The text was updated successfully, but these errors were encountered: