polygon
ElementElement functions can be customized with set
and show
rules.
Element functions can be customized with
set
and show
rules.A closed polygon.
The polygon is defined by its corner points and is closed automatically.
Example
#polygon(
fill: blue.lighten(80%),
stroke: blue,
(20%, 0pt),
(60%, 0pt),
(80%, 2cm),
(0%, 2cm),
)

ParametersParameters are the inputs to a function. They are specified in parentheses after the function name.
Parameters are the inputs to a function. They are specified in parentheses after the function name.
fill
How to fill the polygon. See the rectangle's documentation for more details.
Currently all polygons are filled according to the non-zero winding rule.
Default: none
stroke
How to stroke the polygon. This can be:
See the line's documentation for more details. Can
be set to none
to disable the stroke or to auto
for a stroke of
1pt
black if and if only if no fill is given.
Default: auto
vertices
RequiredPositionalPositional parameters are specified in order, without names.VariadicVariadic parameters can be specified multiple times.
Positional parameters are specified in order, without names.
Variadic parameters can be specified multiple times.
The vertices of the polygon. Each point is specified as an array of two relative lengths.