OptionalactionHow the element's shape is drawn. Defaults to "strokeAndFill"
OptionalarcDraw an arc or ellipticalArc clockwise. Defaults to false
OptionalarcAlso draw the lines from an arc's centre to its ends. Defaults to false
OptionalcanvasThe canvas a canvas element draws
OptionalcanvasThe nested canvas's opacity. Defaults to 1
OptionalcenterThe centre of a circle or arc. Defaults to the centre of the canvas
OptionalclosedJoin the last point of a segments element back to its first. Defaults to false
OptionalcompositeA blend mode for this element only, one of the names in hs.canvas.compositeTypes
OptionalcoordinatesThe points of a segments or points element. c1x/c1y/c2x/c2y curve a segment into its point
OptionalendWhere an arc or ellipticalArc ends, in degrees. Defaults to 360
OptionalfillThe colour to fill the shape with
OptionalfillFill with a gradient instead of fillColor
OptionalfillThe angle of a linear gradient, in degrees. Defaults to 0
OptionalfillThe centre of a radial gradient. Defaults to the centre of the shape's bounds
OptionalfillThe gradient's colours, at least two, evenly spaced
OptionalframeThe bounds of a rectangle, oval, ellipticalArc, text, image or canvas. Defaults to the whole canvas; a missing x or y is 0, and a missing w or h is the canvas's
OptionalidYour own value for the element, passed back to mouse callbacks
OptionalimageThe image of an image element
OptionalimageWhere the image sits in its frame. Defaults to "center"
OptionalimageThe image's opacity. Defaults to 1
OptionalimageHow the image is scaled to its frame. Defaults to "scaleProportionally"
OptionalradiusThe radius of a circle or arc. Defaults to half the canvas's shorter side
OptionalreverseReverse the direction of a circle's path, to cut a hole with build and clip
OptionalrotationDegrees to rotate the element by, about rotationPoint
OptionalrotationThe point to rotate about. Defaults to the centre of the element's bounds
OptionalroundedThe corner radius of a rectangle
OptionalstartWhere an arc or ellipticalArc starts, in degrees. Defaults to 0
OptionalstrokeThe colour to outline the shape with
OptionalstrokeThe width of the shape's outline
OptionaltextThe text of a text element
OptionaltextHow the text is aligned. Defaults to "natural"
OptionaltextThe text's colour. Defaults to black
OptionaltextThe design of the system font, if textFont isn't set
OptionaltextThe PostScript name of the text's font, e.g. "Menlo-Bold"
OptionaltextWhether the text is italic
OptionaltextHow text that doesn't fit is wrapped or cut. Defaults to "wordWrap"
OptionaltextThe text's font size. Defaults to 27
OptionaltextThe text's weight, if textFont isn't set
OptionaltrackReport left mouse button presses on the element to the mouse callback
OptionaltrackReport the mouse entering and leaving the element to the mouse callback
OptionaltrackReport the mouse moving over the element to the mouse callback
OptionaltrackReport left mouse button releases on the element to the mouse callback
OptionaltrackReport right mouse button presses on the element to the mouse callback
OptionaltrackReport right mouse button releases on the element to the mouse callback
OptionaltransformationAn affine transformation matrix, used instead of rotation. Missing entries are the identity matrix's
The kind of element
OptionalwindingHow overlapping parts of a built-up path are filled. Defaults to "nonZero"
One element drawn on a canvas. Only
typeis required; see the canvas guide for what each attribute does and which element types read it. Positions and sizes are numbers of points, or percentage strings such as"50%"of the canvas's size