polygonElementElementElement functions can be customized with set and show rules.
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),
)

ParameterParameterParameters are input values for functions. Specify them in parentheses after the function name.
polygon(fill:,,,)->How to fill the polygon.
When setting a fill, the default stroke disappears. To create a rectangle with both fill and stroke, you have to configure both.
nonefill-ruleSettableSettableSettable parameters can be set using the set rule, changing the default value used thereafter.
fill-ruleset rule, changing the default value used thereafter.The drawing rule used to fill the polygon.
See the curve documentation for an example.
Available string values
non-zeroSpecifies that "inside" is computed by a non-zero sum of signed edge crossings.
even-oddSpecifies that "inside" is computed by an odd number of edge crossings.
"non-zero"How to stroke the polygon.
Can be set to none to disable the stroke or to auto for a
stroke of 1pt black if and only if no fill is given.
autoverticesRequiredRequiredRequired parameters must be specified when calling the function.PositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.VariadicVariadicVariadic parameters can be specified multiple times.
verticesThe vertices of the polygon. Each point is specified as an array of two relative lengths.
DefinitionsDefinitionsThese functions and types can have related definitions. To access a definition, specify the name of the function or type, followed by the definition name separated by a period.
regular
regularA regular polygon, defined by its size and number of vertices.
Show example
#polygon.regular(
fill: blue.lighten(80%),
stroke: blue,
size: 30pt,
vertices: 3,
)

polygon.regular(fill:,,size:,)->How to fill the polygon. See the general polygon's documentation for more details.
How to stroke the polygon. See the general polygon's documentation for more details.