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
To create a new LinearGradient, one has to use something like
const{ LinearGradient, Color }=require('scenegraph');// Import classesletgradient=newLinearGradient();// Create "empty" gradient"gradient.colorStops=[{stop: 0.0,color: newColor('#ff0000')},{stop: 1.0,color: newColor('#ff00ff')},];// Assign colors to gradientnode.fill=gradient;// Assign gradient as fill
node.fill = new LinearGradient() would throw an error about a gradient having to have at least two color stops. This, however, is neither obvious from the docs nor intuitive (since there's also no constructor providing the ability to add those two color stops quickly), which is why I'd argue that it might be wise to add a note about this (or better: example code) to the section in the docs (https://adobexdplatform.com/plugin-docs/reference/LinearGradientFill.html#new-lineargradientfill) to avoid (unnecessary) confusion.
Proposed solution or attempted solutions that failed
Add a note or some example code demonstrating this behavior to the section in the docs to make it clear how to assign a newLinearGradient as fill
The text was updated successfully, but these errors were encountered:
Submit an issue
Topic
This is an issue regarding:
Versions
Description of the issue
To create a new
LinearGradient
, one has to use something likenode.fill = new LinearGradient()
would throw an error about a gradient having to have at least two color stops. This, however, is neither obvious from the docs nor intuitive (since there's also no constructor providing the ability to add those two color stops quickly), which is why I'd argue that it might be wise to add a note about this (or better: example code) to the section in the docs (https://adobexdplatform.com/plugin-docs/reference/LinearGradientFill.html#new-lineargradientfill) to avoid (unnecessary) confusion.Proposed solution or attempted solutions that failed
Add a note or some example code demonstrating this behavior to the section in the docs to make it clear how to assign a new
LinearGradient
asfill
The text was updated successfully, but these errors were encountered: