polygon元素元素元素函数可用set和show规则自定义样式。
set和show规则自定义样式。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),
)

参数参数参数是传给函数的输入,写在函数名后的括号中。
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.
Currently all polygons are filled according to the non-zero winding rule.
默认值: none
stroke
How to stroke the polygon. This can be:
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.
默认值: auto
vertices
The vertices of the polygon. Each point is specified as an array of two relative lengths.
定义定义这些函数和类型带有附属定义。要访问这种定义,请先写上函数或类型的名称,再加上定义的名称,并用句点在中间分隔。
regular
A regular polygon, defined by its size and number of vertices.
展开例子
#polygon.regular(
fill: blue.lighten(80%),
stroke: blue,
size: 30pt,
vertices: 3,
)

fill
How to fill the polygon. See the general polygon's documentation for more details.
stroke
How to stroke the polygon. See the general polygon's documentation for more details.