addShapeLayer()
Add a rasterized shape layer with fill and/or stroke styling.The created layer’s ID
Shape Types
Rectangle
Rounded Rectangle
Ellipse
Line
Polygon
For polygons, thewidth and height are optional. If not provided, they’re derived from the points.
Fill and Stroke Styling
Fill
Fill color is specified as a 4-byte RGBA array:Stroke
Stroke is an object withcolor (RGBA array) and width (number):
Fill and Stroke Requirements
You must provide at least one offill or stroke. You can provide both: